[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-4650c7bed79582c74452d284e45d5b76987c0ef3@git.kernel.org>
Date: Wed, 17 Jul 2019 15:59:05 -0700
From: tip-bot for Adrian Hunter <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: jolsa@...hat.com, acme@...hat.com, hpa@...or.com,
tglx@...utronix.de, adrian.hunter@...el.com, mingo@...nel.org,
linux-kernel@...r.kernel.org
Subject: [tip:perf/urgent] perf db-export: Also export thread's current comm
Commit-ID: 4650c7bed79582c74452d284e45d5b76987c0ef3
Gitweb: https://git.kernel.org/tip/4650c7bed79582c74452d284e45d5b76987c0ef3
Author: Adrian Hunter <adrian.hunter@...el.com>
AuthorDate: Wed, 10 Jul 2019 11:58:01 +0300
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Wed, 10 Jul 2019 12:14:07 -0300
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@...el.com>
Cc: Jiri Olsa <jolsa@...hat.com>
Link: http://lkml.kernel.org/r/20190710085810.1650-13-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/util/db-export.c | 8 ++++++++
1 file changed, 8 insertions(+)
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,
};
struct thread *main_thread;
struct comm *comm = NULL;
+ struct comm *curr_comm;
int err;
err = db_export__evsel(dbe, evsel);
@@ -350,6 +351,13 @@ int db_export__sample(struct db_export *dbe, union perf_event *event,
}
}
+ curr_comm = thread__comm(thread);
+ if (curr_comm) {
+ err = db_export__comm(dbe, curr_comm, thread);
+ if (err)
+ goto out_put;
+ }
+
es.db_id = ++dbe->sample_last_db_id;
err = db_ids_from_al(dbe, al, &es.dso_db_id, &es.sym_db_id, &es.offset);
Powered by blists - more mailing lists