diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2019-07-10 04:58:01 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-07-10 11:14:07 -0400 |
commit | 4650c7bed79582c74452d284e45d5b76987c0ef3 (patch) | |
tree | 190b693529fe00eac4581a53828f245eeea00eab /tools | |
parent | 80859c947a1eb170927d03e713abf7550a3d8766 (diff) |
perf db-export: Also export thread's current comm
Currently, the initial comm of the main thread is exported. Export also
a thread's current comm. That better supports the tracing of
multi-threaded applications that set different comms for different
threads to make it easier to distinguish them.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/20190710085810.1650-13-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/db-export.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/perf/util/db-export.c b/tools/perf/util/db-export.c index b1e581c13963..5057fdd7f62d 100644 --- a/tools/perf/util/db-export.c +++ b/tools/perf/util/db-export.c | |||
@@ -299,6 +299,7 @@ int db_export__sample(struct db_export *dbe, union perf_event *event, | |||
299 | }; | 299 | }; |
300 | struct thread *main_thread; | 300 | struct thread *main_thread; |
301 | struct comm *comm = NULL; | 301 | struct comm *comm = NULL; |
302 | struct comm *curr_comm; | ||
302 | int err; | 303 | int err; |
303 | 304 | ||
304 | err = db_export__evsel(dbe, evsel); | 305 | err = db_export__evsel(dbe, evsel); |
@@ -350,6 +351,13 @@ int db_export__sample(struct db_export *dbe, union perf_event *event, | |||
350 | } | 351 | } |
351 | } | 352 | } |
352 | 353 | ||
354 | curr_comm = thread__comm(thread); | ||
355 | if (curr_comm) { | ||
356 | err = db_export__comm(dbe, curr_comm, thread); | ||
357 | if (err) | ||
358 | goto out_put; | ||
359 | } | ||
360 | |||
353 | es.db_id = ++dbe->sample_last_db_id; | 361 | es.db_id = ++dbe->sample_last_db_id; |
354 | 362 | ||
355 | err = db_ids_from_al(dbe, al, &es.dso_db_id, &es.sym_db_id, &es.offset); | 363 | err = db_ids_from_al(dbe, al, &es.dso_db_id, &es.sym_db_id, &es.offset); |