Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'perf-urgent-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent

Pull perf/urgent fixes from Arnaldo Carvalho de Melo:

- In some cases where perf_event.fork.{pid,tid} should be used we were instead
using perf_event.comm.{pid,tid}, which is not a problem for for the 'pid'
case, that sits in the same place in these union_perf_event members, but
comm.tid sits where fork.ppid is, oops.

These cases were considered as (potentially) problematic:

- 'perf script' with !sample_id_all, i.e. only non old kernels without
perf_event_attr.sample_id_all.

- intel_pt could be affected when decoding without timestamps, as the exit
event is only used to flush out data which anyway gets flushed at the
end of the session.

- intel_bts also uses the exit event to flush data which would probably not
cause errors as it would get flushed at the end of the session instead.

Fix it. (Adrian Hunter)

- Due to relaxing the compiler checks for bison generated files, we missed
updating one parse_events_add_pmu() caller when this function had its
prototype changed, fix it. (Jiri Olsa)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>

+5 -5
+2 -2
tools/perf/builtin-script.c
··· 768 768 if (!evsel->attr.sample_id_all) { 769 769 sample->cpu = 0; 770 770 sample->time = 0; 771 - sample->tid = event->comm.tid; 772 - sample->pid = event->comm.pid; 771 + sample->tid = event->fork.tid; 772 + sample->pid = event->fork.pid; 773 773 } 774 774 print_sample_start(sample, thread, evsel); 775 775 perf_event__fprintf(event, stdout);
+1 -1
tools/perf/util/intel-bts.c
··· 623 623 if (err) 624 624 return err; 625 625 if (event->header.type == PERF_RECORD_EXIT) { 626 - err = intel_bts_process_tid_exit(bts, event->comm.tid); 626 + err = intel_bts_process_tid_exit(bts, event->fork.tid); 627 627 if (err) 628 628 return err; 629 629 }
+1 -1
tools/perf/util/intel-pt.c
··· 1494 1494 if (pt->timeless_decoding) { 1495 1495 if (event->header.type == PERF_RECORD_EXIT) { 1496 1496 err = intel_pt_process_timeless_queues(pt, 1497 - event->comm.tid, 1497 + event->fork.tid, 1498 1498 sample->time); 1499 1499 } 1500 1500 } else if (timestamp) {
+1 -1
tools/perf/util/parse-events.y
··· 255 255 list_add_tail(&term->list, head); 256 256 257 257 ALLOC_LIST(list); 258 - ABORT_ON(parse_events_add_pmu(list, &data->idx, "cpu", head)); 258 + ABORT_ON(parse_events_add_pmu(data, list, "cpu", head)); 259 259 parse_events__free_terms(head); 260 260 $$ = list; 261 261 }