Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1500172
| From | Stephane Eranian <eranian@google.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 3/9] perf/jit: remove unecessary padding in jitdump file |
| Date | 2016-10-13 13:10 +0200 |
| Message-ID | <srM3E-2I3-39@gated-at.bofh.it> (permalink) |
| References | <srM3D-2I3-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
This patch removes all the string padding generated in
the jitdump file. There are nonecessary and were adding
unecessary complexity. Modern processors can handle unaligned
accesses quite well. The perf.data/jitdump file are always
postp-processed, no need to add extra complexity for no real
gain.
Signed-off-by: Stephane Eranian <eranian@google.com>
---
tools/perf/jvmti/jvmti_agent.c | 38 +-------------------------------------
1 file changed, 1 insertion(+), 37 deletions(-)
diff --git a/tools/perf/jvmti/jvmti_agent.c b/tools/perf/jvmti/jvmti_agent.c
index 55daefff0d54..e9651a9d670e 100644
--- a/tools/perf/jvmti/jvmti_agent.c
+++ b/tools/perf/jvmti/jvmti_agent.c
@@ -44,11 +44,6 @@
static char jit_path[PATH_MAX];
static void *marker_addr;
-/*
- * padding buffer
- */
-static const char pad_bytes[7];
-
static inline pid_t gettid(void)
{
return (pid_t)syscall(__NR_gettid);
@@ -230,7 +225,6 @@ init_arch_timestamp(void)
void *jvmti_open(void)
{
- int pad_cnt;
char dump_path[PATH_MAX];
struct jitheader header;
int fd;
@@ -288,10 +282,6 @@ void *jvmti_open(void)
header.total_size = sizeof(header);
header.pid = getpid();
- /* calculate amount of padding '\0' */
- pad_cnt = PADDING_8ALIGNED(header.total_size);
- header.total_size += pad_cnt;
-
header.timestamp = perf_get_timestamp();
if (use_arch_timestamp)
@@ -301,13 +291,6 @@ void *jvmti_open(void)
warn("jvmti: cannot write dumpfile header");
goto error;
}
-
- /* write padding '\0' if necessary */
- if (pad_cnt && !fwrite(pad_bytes, pad_cnt, 1, fp)) {
- warn("jvmti: cannot write dumpfile header padding");
- goto error;
- }
-
return fp;
error:
fclose(fp);
@@ -349,7 +332,6 @@ jvmti_write_code(void *agent, char const *sym,
static int code_generation = 1;
struct jr_code_load rec;
size_t sym_len;
- size_t padding_count;
FILE *fp = agent;
int ret = -1;
@@ -366,8 +348,6 @@ jvmti_write_code(void *agent, char const *sym,
rec.p.id = JIT_CODE_LOAD;
rec.p.total_size = sizeof(rec) + sym_len;
- padding_count = PADDING_8ALIGNED(rec.p.total_size);
- rec.p. total_size += padding_count;
rec.p.timestamp = perf_get_timestamp();
rec.code_size = size;
@@ -393,9 +373,6 @@ jvmti_write_code(void *agent, char const *sym,
ret = fwrite_unlocked(&rec, sizeof(rec), 1, fp);
fwrite_unlocked(sym, sym_len, 1, fp);
- if (padding_count)
- fwrite_unlocked(pad_bytes, padding_count, 1, fp);
-
if (code)
fwrite_unlocked(code, size, 1, fp);
@@ -412,7 +389,6 @@ jvmti_write_debug_info(void *agent, uint64_t code, const char *file,
{
struct jr_code_debug_info rec;
size_t sret, len, size, flen;
- size_t padding_count;
uint64_t addr;
const char *fn = file;
FILE *fp = agent;
@@ -443,16 +419,10 @@ jvmti_write_debug_info(void *agent, uint64_t code, const char *file,
* int : line number
* int : column discriminator
* file[] : source file name
- * padding : pad to multiple of 8 bytes
*/
size += nr_lines * sizeof(struct debug_entry);
size += flen * nr_lines;
- /*
- * pad to 8 bytes
- */
- padding_count = PADDING_8ALIGNED(size);
-
- rec.p.total_size = size + padding_count;
+ rec.p.total_size = size;
/*
* If JVM is multi-threaded, nultiple concurrent calls to agent
@@ -486,12 +456,6 @@ jvmti_write_debug_info(void *agent, uint64_t code, const char *file,
if (sret != 1)
goto error;
}
- if (padding_count) {
- sret = fwrite_unlocked(pad_bytes, padding_count, 1, fp);
- if (sret != 1)
- goto error;
- }
-
funlockfile(fp);
return 0;
error:
--
1.9.1
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/9] perf/jit: various improvements Stephane Eranian <eranian@google.com> - 2016-10-13 13:10 +0200
[PATCH 1/9] perf/jit: improve error messages from JVMTI Stephane Eranian <eranian@google.com> - 2016-10-13 13:10 +0200
Re: [PATCH 1/9] perf/jit: improve error messages from JVMTI Nilay Vaish <nilayvaish@gmail.com> - 2016-10-13 22:30 +0200
Re: [PATCH 1/9] perf/jit: improve error messages from JVMTI Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-10-14 13:20 +0200
Re: [PATCH 1/9] perf/jit: improve error messages from JVMTI Stephane Eranian <eranian@google.com> - 2016-10-14 15:30 +0200
Re: [PATCH 1/9] perf/jit: improve error messages from JVMTI Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-10-14 17:30 +0200
Re: [PATCH 1/9] perf/jit: improve error messages from JVMTI Stephane Eranian <eranian@google.com> - 2016-10-17 16:00 +0200
[tip:perf/core] perf jit: Improve error messages from JVMTI tip-bot for Stephane Eranian <tipbot@zytor.com> - 2016-10-24 21:10 +0200
[PATCH 5/9] perf/jit: do not assume pgoff is zero Stephane Eranian <eranian@google.com> - 2016-10-13 13:10 +0200
[tip:perf/core] perf jit: Do not assume pgoff is zero tip-bot for Stefano Sanfilippo <tipbot@zytor.com> - 2016-10-24 21:10 +0200
[PATCH 8/9] perf/jit: Check JITHEADER_VERSION Stephane Eranian <eranian@google.com> - 2016-10-13 13:10 +0200
[tip:perf/core] perf jit: Check JITHEADER_VERSION tip-bot for Stefano Sanfilippo <tipbot@zytor.com> - 2016-10-24 21:10 +0200
[PATCH 3/9] perf/jit: remove unecessary padding in jitdump file Stephane Eranian <eranian@google.com> - 2016-10-13 13:10 +0200
[tip:perf/core] perf jit: Remove unecessary padding in jitdump file tip-bot for Stephane Eranian <tipbot@zytor.com> - 2016-10-24 21:00 +0200
[PATCH 6/9] perf/jit: add unwinding support Stephane Eranian <eranian@google.com> - 2016-10-13 13:10 +0200
[tip:perf/core] perf jit: Add unwinding support tip-bot for Stefano Sanfilippo <tipbot@zytor.com> - 2016-10-24 21:10 +0200
[PATCH 2/9] perf/jit: enable jitdump support without dwarf Stephane Eranian <eranian@google.com> - 2016-10-13 13:10 +0200
Re: [PATCH 2/9] perf/jit: enable jitdump support without dwarf Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-10-13 20:20 +0200
Re: [PATCH 2/9] perf/jit: enable jitdump support without dwarf Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-10-13 21:00 +0200
Re: [PATCH 2/9] perf/jit: enable jitdump support without dwarf Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-10-13 21:20 +0200
Re: [PATCH 2/9] perf/jit: enable jitdump support without dwarf Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-10-13 21:50 +0200
Re: [PATCH 2/9] perf/jit: enable jitdump support without dwarf Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-10-13 21:40 +0200
[tip:perf/core] perf jit: Enable jitdump support without dwarf tip-bot for Maciej Debski <tipbot@zytor.com> - 2016-10-24 21:00 +0200
csiph-web