diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/bench/mem-memcpy-x86-64-asm.S | 6 | ||||
-rw-r--r-- | tools/perf/util/evsel.c | 1 | ||||
-rw-r--r-- | tools/perf/util/hist.c | 12 | ||||
-rw-r--r-- | tools/perf/util/sort.c | 3 | ||||
-rw-r--r-- | tools/perf/util/trace-event-parse.c | 2 |
5 files changed, 24 insertions, 0 deletions
diff --git a/tools/perf/bench/mem-memcpy-x86-64-asm.S b/tools/perf/bench/mem-memcpy-x86-64-asm.S index a57b66e..185a96d 100644 --- a/tools/perf/bench/mem-memcpy-x86-64-asm.S +++ b/tools/perf/bench/mem-memcpy-x86-64-asm.S @@ -1,2 +1,8 @@ #include "../../../arch/x86/lib/memcpy_64.S" +/* + * We need to provide note.GNU-stack section, saying that we want + * NOT executable stack. Otherwise the final linking will assume that + * the ELF stack should not be restricted at all and set it RWX. + */ +.section .note.GNU-stack,"",@progbits diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 0239eb8..ad2183c 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -348,6 +348,7 @@ int perf_event__parse_sample(const union perf_event *event, u64 type, data->cpu = data->pid = data->tid = -1; data->stream_id = data->id = data->time = -1ULL; + data->period = 1; if (event->header.type != PERF_RECORD_SAMPLE) { if (!sample_id_all) diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 627a02e..fb69599 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c @@ -158,6 +158,18 @@ struct hist_entry *__hists__add_entry(struct hists *self, if (!cmp) { he->period += period; ++he->nr_events; + + /* If the map of an existing hist_entry has + * become out-of-date due to an exec() or + * similar, update it. Otherwise we will + * mis-adjust symbol addresses when computing + * the history counter to increment. + */ + if (he->ms.map != entry.ms.map) { + he->ms.map = entry.ms.map; + if (he->ms.map) + he->ms.map->referenced = true; + } goto out; } diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c index f44fa54..0ffbc8e 100644 --- a/tools/perf/util/sort.c +++ b/tools/perf/util/sort.c @@ -122,6 +122,9 @@ static int repsep_snprintf(char *bf, size_t size, const char *fmt, ...) } } va_end(ap); + + if (n >= (int)size) + return size - 1; return n; } diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c index 6c164dc..bf54c48 100644 --- a/tools/perf/util/trace-event-parse.c +++ b/tools/perf/util/trace-event-parse.c @@ -1582,6 +1582,8 @@ process_symbols(struct event *event, struct print_arg *arg, char **tok) field = malloc_or_die(sizeof(*field)); type = process_arg(event, field, &token); + while (type == EVENT_OP) + type = process_op(event, field, &token); if (test_type_token(type, token, EVENT_DELIM, ",")) goto out_free; |