perf/urgent fixes:

- 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>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJV6G54AAoJENZQFvNTUqpAQT4P/Rx3mWgqhy1oDbIEaOMrewmH
 Udtltd9q8HAkLqMOHgR9ilwnUNeB2gw/uFdPdDaBCj3ACPKpoWnXrwU+buOultUO
 IwPZGt5WiPGHxJ7vE6sSR3v8M0loFtezJO6vlU9q0B+jtxn6XoyHXboVzekUVpwY
 Q7iYLX9ntOTG81nuk2c8rTf6lI4m+pSYOMGjLqDCB6cE4DMavUIzaLPIoSTEO1Ut
 V5IDwn9sfy2OElLXrN+QCZJn8qTy5WydRHFeUDYsA3ABUukEksygV+oePNomd1wH
 imYlatETRJX1GeN4fsYeR2pqa3du3Q20yMei00oVsxAwu02VUDUxbq8mvCoaQr6s
 r4dltN9iv6ByG5uyQ168ZVRXDyf+TxTqm3365JY5w6eFwJBKW2zDMtMf+hPC7B0P
 IqfAYNbQSM60npPzQEOmu0fp/Tr9fYHzJmg+ycigLILsgL0ZN7abK86kIkkkDbSY
 6M/aEAC9CxKL/wnyTGx6itovEEuRYOoshvWfAb0Hfqa9eWjAXu2GxsGHkCE4tZuf
 zMZihqdA5gW4QJJ5rUrV3OPgHTl1WQRIq0mwp2kijS7AQ72egDKJ48TE89W1115v
 Uw/FqhuiTVHEyT3/eFZ6f03K3Zyg+O8tF6bGoIxYrZ058QJRHcvzVCupWeZx4tki
 Z6SdKCs6atywgG3hTU1B
 =M0yL
 -----END PGP SIGNATURE-----

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>
This commit is contained in:
Ingo Molnar 2015-09-04 11:00:56 +02:00
commit 21adf76e90
4 changed files with 5 additions and 5 deletions

View File

@ -768,8 +768,8 @@ static int process_exit_event(struct perf_tool *tool,
if (!evsel->attr.sample_id_all) {
sample->cpu = 0;
sample->time = 0;
sample->tid = event->comm.tid;
sample->pid = event->comm.pid;
sample->tid = event->fork.tid;
sample->pid = event->fork.pid;
}
print_sample_start(sample, thread, evsel);
perf_event__fprintf(event, stdout);

View File

@ -623,7 +623,7 @@ static int intel_bts_process_event(struct perf_session *session,
if (err)
return err;
if (event->header.type == PERF_RECORD_EXIT) {
err = intel_bts_process_tid_exit(bts, event->comm.tid);
err = intel_bts_process_tid_exit(bts, event->fork.tid);
if (err)
return err;
}

View File

@ -1494,7 +1494,7 @@ static int intel_pt_process_event(struct perf_session *session,
if (pt->timeless_decoding) {
if (event->header.type == PERF_RECORD_EXIT) {
err = intel_pt_process_timeless_queues(pt,
event->comm.tid,
event->fork.tid,
sample->time);
}
} else if (timestamp) {

View File

@ -255,7 +255,7 @@ PE_PMU_EVENT_PRE '-' PE_PMU_EVENT_SUF sep_dc
list_add_tail(&term->list, head);
ALLOC_LIST(list);
ABORT_ON(parse_events_add_pmu(list, &data->idx, "cpu", head));
ABORT_ON(parse_events_add_pmu(data, list, "cpu", head));
parse_events__free_terms(head);
$$ = list;
}