Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1681637
| From | Arun Kalyanasundaram <arunkaly@google.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: perf script: Question: Python trace processing script contains the tid of the process in the common_pid attribute |
| Date | 2017-07-05 18:30 +0200 |
| Message-ID | <tZVlD-aF-1@gated-at.bofh.it> (permalink) |
| References | <tYrSG-4qO-13@gated-at.bofh.it> <tYrSG-4qO-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi Arnaldo, Thank you for your reply. I actually meant tracepoint event handlers: def trace_unhandled(event_name, context, event_fields_dict) The dict parameter contains an attribute "common_pid" which is actually the "tid" of the thread. There are no other attributes that contain the actual pid of the process. So, I was wondering if this is something intentional? If not I can share a patch to fix this. Best, - Arun On Sat, Jul 1, 2017 at 7:47 AM, Arnaldo Carvalho de Melo <acme@redhat.com> wrote: > Em Fri, Jun 30, 2017 at 03:40:57PM -0700, Arun Kalyanasundaram escreveu: >> The handlers in the python script generated from "perf script" have an >> attribute: common_pid. This attribute contains the tid of the process >> instead of its pid. I would like to know if this is the expected behavior. >> There are no other attributes in the Python handler that provide the pid >> and knowing the process id is useful to be able to group all samples that >> belong to the same process that generated different threads. > > Humm, you have: > > def process_event(param_dict): > event_attr = param_dict["attr"] > sample = param_dict["sample"] > raw_buf = param_dict["raw_buf"] > comm = param_dict["comm"] > name = param_dict["ev_name"] > > And then, on sample you have (from a recent python script for processing > Intel PT samples): > > def print_common_start(comm, sample, name): > ts = sample["time"] > cpu = sample["cpu"] > pid = sample["pid"] > tid = sample["tid"] > print "%16s %5u/%-5u [%03u] %9u.%09u %7s:" % (comm, pid, tid, cpu, ts / 1000000000, ts %1000000000, name), > > - Arnaldo
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
Re: perf script: Question: Python trace processing script contains the tid of the process in the common_pid attribute Arun Kalyanasundaram <arunkaly@google.com> - 2017-07-05 18:30 +0200
Re: perf script: Question: Python trace processing script contains the tid of the process in the common_pid attribute Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-05 21:30 +0200
Re: perf script: Question: Python trace processing script contains the tid of the process in the common_pid attribute Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-05 21:30 +0200
Re: perf script: Question: Python trace processing script contains the tid of the process in the common_pid attribute Arun Kalyanasundaram <arunkaly@google.com> - 2017-07-05 22:50 +0200
Re: perf script: Question: Python trace processing script contains the tid of the process in the common_pid attribute Arun Kalyanasundaram <arunkaly@google.com> - 2017-07-06 02:00 +0200
Re: perf script: Question: Python trace processing script contains the tid of the process in the common_pid attribute Arnaldo Carvalho de Melo <acme@redhat.com> - 2017-07-07 17:20 +0200
csiph-web