From: tip-bot for Stephane Eranian <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: tglx@linutronix.de, hpa@zytor.com, acme@redhat.com,
mingo@kernel.org, jolsa@redhat.com, namhyung@kernel.org,
peterz@infradead.org, eranian@google.com, anton@ozlabs.org,
linux-kernel@vger.kernel.org
Subject: [tip:perf/core] perf jit: Remove unecessary padding in jitdump file
Date: Mon, 24 Oct 2016 11:59:05 -0700 [thread overview]
Message-ID: <tip-13b9012ab42ee93dabe8555f2e701ca139180f85@git.kernel.org> (raw)
In-Reply-To: <1476356383-30100-4-git-send-email-eranian@google.com>
Commit-ID: 13b9012ab42ee93dabe8555f2e701ca139180f85
Gitweb: http://git.kernel.org/tip/13b9012ab42ee93dabe8555f2e701ca139180f85
Author: Stephane Eranian <eranian@google.com>
AuthorDate: Thu, 13 Oct 2016 03:59:37 -0700
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 24 Oct 2016 11:07:38 -0300
perf jit: Remove unecessary padding in jitdump file
This patch removes all the string padding generated in the jitdump file.
They are not necessary and were adding unnecessary complexity. Modern
processors can handle unaligned accesses quite well. The perf.data/
jitdump file are always post-processed, no need to add extra complexity
for no real gain.
Signed-off-by: Stephane Eranian <eranian@google.com>
Cc: Anton Blanchard <anton@ozlabs.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1476356383-30100-4-git-send-email-eranian@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.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 55daeff..e9651a9 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:
next prev parent reply other threads:[~2016-10-24 18:59 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-13 10:59 [PATCH 0/9] perf/jit: various improvements Stephane Eranian
2016-10-13 10:59 ` [PATCH 1/9] perf/jit: improve error messages from JVMTI Stephane Eranian
2016-10-13 20:05 ` Nilay Vaish
2016-10-14 11:13 ` Arnaldo Carvalho de Melo
2016-10-14 12:57 ` Stephane Eranian
2016-10-14 15:20 ` Arnaldo Carvalho de Melo
2016-10-17 13:52 ` Stephane Eranian
2016-10-24 18:58 ` [tip:perf/core] perf jit: Improve " tip-bot for Stephane Eranian
2016-10-13 10:59 ` [PATCH 2/9] perf/jit: enable jitdump support without dwarf Stephane Eranian
2016-10-13 18:16 ` Arnaldo Carvalho de Melo
2016-10-13 18:37 ` Arnaldo Carvalho de Melo
2016-10-13 18:51 ` Arnaldo Carvalho de Melo
2016-10-13 19:03 ` Arnaldo Carvalho de Melo
2016-10-13 19:44 ` Arnaldo Carvalho de Melo
2016-10-24 18:58 ` [tip:perf/core] perf jit: Enable " tip-bot for Maciej Debski
2016-10-13 10:59 ` [PATCH 3/9] perf/jit: remove unecessary padding in jitdump file Stephane Eranian
2016-10-24 18:59 ` tip-bot for Stephane Eranian [this message]
2016-10-13 10:59 ` [PATCH 4/9] perf/jit: make perf skip unknown records Stephane Eranian
2016-10-24 18:59 ` [tip:perf/core] perf jit: Make " tip-bot for Stefano Sanfilippo
2016-10-13 10:59 ` [PATCH 5/9] perf/jit: do not assume pgoff is zero Stephane Eranian
2016-10-24 19:00 ` [tip:perf/core] perf jit: Do " tip-bot for Stefano Sanfilippo
2016-10-13 10:59 ` [PATCH 6/9] perf/jit: add unwinding support Stephane Eranian
2016-10-24 19:00 ` [tip:perf/core] perf jit: Add " tip-bot for Stefano Sanfilippo
2016-10-13 10:59 ` [PATCH 7/9] perf/jit: generate .eh_frame/.eh_frame_hdr in DSO Stephane Eranian
2016-10-24 19:01 ` [tip:perf/core] perf jit: Generate " tip-bot for Stefano Sanfilippo
2016-10-13 10:59 ` [PATCH 8/9] perf/jit: Check JITHEADER_VERSION Stephane Eranian
2016-10-24 19:01 ` [tip:perf/core] perf jit: " tip-bot for Stefano Sanfilippo
2016-10-13 10:59 ` [PATCH 9/9] perf/jit: add jitdump format specification document Stephane Eranian
2016-10-24 19:02 ` [tip:perf/core] perf jit: Add " tip-bot for Stephane Eranian
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-13b9012ab42ee93dabe8555f2e701ca139180f85@git.kernel.org \
--to=tipbot@zytor.com \
--cc=acme@redhat.com \
--cc=anton@ozlabs.org \
--cc=eranian@google.com \
--cc=hpa@zytor.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.