Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1730120
| From | kan.liang@intel.com |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH RFC V2 04/10] petf tools: introduce a new function to set namespaces id |
| Date | 2017-09-11 04:30 +0200 |
| Message-ID | <uomE1-4Gu-7@gated-at.bofh.it> (permalink) |
| References | <uomE1-4Gu-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Kan Liang <kan.liang@intel.com>
Finish the namespaces id setting job in thread.c.
Signed-off-by: Kan Liang <kan.liang@intel.com>
---
tools/perf/util/hist.c | 7 ++-----
tools/perf/util/thread.c | 10 ++++++++++
tools/perf/util/thread.h | 2 ++
3 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 0f00dd9..e332c4f 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -584,14 +584,9 @@ __hists__add_entry(struct hists *hists,
bool sample_self,
struct hist_entry_ops *ops)
{
- struct namespaces *ns = thread__namespaces(al->thread);
struct hist_entry entry = {
.thread = al->thread,
.comm_str = thread__comm_str(al->thread),
- .cgroup_id = {
- .dev = ns ? ns->link_info[CGROUP_NS_INDEX].dev : 0,
- .ino = ns ? ns->link_info[CGROUP_NS_INDEX].ino : 0,
- },
.ms = {
.map = al->map,
.sym = al->sym,
@@ -617,6 +612,8 @@ __hists__add_entry(struct hists *hists,
.ops = ops,
};
+ thread__namespaces_id(al->thread, &entry.cgroup_id.dev,
+ &entry.cgroup_id.ino);
return hists__findnew_entry(hists, &entry, al, sample_self);
}
diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c
index aee9a42..b7957da 100644
--- a/tools/perf/util/thread.c
+++ b/tools/perf/util/thread.c
@@ -149,6 +149,16 @@ int thread__set_namespaces(struct thread *thread, u64 timestamp,
return 0;
}
+void thread__namespaces_id(const struct thread *thread,
+ u64 *dev, u64 *ino)
+{
+ struct namespaces *ns;
+
+ ns = thread__namespaces(thread);
+ *dev = ns ? ns->link_info[CGROUP_NS_INDEX].dev : 0;
+ *ino = ns ? ns->link_info[CGROUP_NS_INDEX].ino : 0;
+}
+
struct comm *thread__comm(const struct thread *thread)
{
if (list_empty(&thread->comm_list))
diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h
index cb1a5dd..fd7bd41 100644
--- a/tools/perf/util/thread.h
+++ b/tools/perf/util/thread.h
@@ -68,6 +68,8 @@ static inline void thread__exited(struct thread *thread)
struct namespaces *thread__namespaces(const struct thread *thread);
int thread__set_namespaces(struct thread *thread, u64 timestamp,
struct namespaces_event *event);
+void thread__namespaces_id(const struct thread *thread,
+ u64 *dev, u64 *ino);
int __thread__set_comm(struct thread *thread, const char *comm, u64 timestamp,
bool exec);
--
2.5.5
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH RFC V2 00/10] perf top optimization kan.liang@intel.com - 2017-09-11 04:30 +0200
[PATCH RFC V2 10/10] perf top: switch back to overwrite mode kan.liang@intel.com - 2017-09-11 04:30 +0200
[PATCH RFC V2 04/10] petf tools: introduce a new function to set namespaces id kan.liang@intel.com - 2017-09-11 04:30 +0200
[PATCH RFC V2 06/10] perf tools: lock to protect comm_str rb tree kan.liang@intel.com - 2017-09-11 04:30 +0200
[PATCH RFC V2 02/10] perf tools: using scandir to replace readdir kan.liang@intel.com - 2017-09-11 04:30 +0200
Re: [PATCH RFC V2 02/10] perf tools: using scandir to replace readdir Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-09-13 17:30 +0200
[PATCH RFC V2 03/10] petf tools: using comm_str to replace comm in hist_entry kan.liang@intel.com - 2017-09-11 04:30 +0200
Re: [PATCH RFC V2 03/10] petf tools: using comm_str to replace comm in hist_entry Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-09-13 17:30 +0200
Re: [PATCH RFC V2 03/10] petf tools: using comm_str to replace comm in hist_entry Jiri Olsa <jolsa@redhat.com> - 2017-09-18 10:40 +0200
[PATCH RFC V2 01/10] perf tools: hashtable for machine threads kan.liang@intel.com - 2017-09-11 04:30 +0200
Re: [PATCH RFC V2 01/10] perf tools: hashtable for machine threads Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-09-13 15:30 +0200
[tip:perf/core] perf machine: Use hashtable for machine threads tip-bot for Kan Liang <tipbot@zytor.com> - 2017-09-22 18:50 +0200
[PATCH RFC V2 08/10] perf top: implement multithreading for perf_event__synthesize_threads kan.liang@intel.com - 2017-09-11 04:30 +0200
Re: [PATCH RFC V2 08/10] perf top: implement multithreading for perf_event__synthesize_threads Jiri Olsa <jolsa@redhat.com> - 2017-09-18 13:30 +0200
[PATCH RFC V2 07/10] perf tools: change machine comm_exec type to atomic kan.liang@intel.com - 2017-09-11 04:30 +0200
Re: [PATCH RFC V2 07/10] perf tools: change machine comm_exec type to atomic Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-09-13 17:30 +0200
RE: [PATCH RFC V2 07/10] perf tools: change machine comm_exec type to atomic "Liang, Kan" <kan.liang@intel.com> - 2017-09-15 22:10 +0200
Re: [PATCH RFC V2 07/10] perf tools: change machine comm_exec type to atomic Jiri Olsa <jolsa@redhat.com> - 2017-09-18 13:40 +0200
[PATCH RFC V2 05/10] perf tools: lock to protect thread list kan.liang@intel.com - 2017-09-11 04:30 +0200
Re: [PATCH RFC V2 05/10] perf tools: lock to protect thread list Jiri Olsa <jolsa@redhat.com> - 2017-09-18 11:00 +0200
RE: [PATCH RFC V2 05/10] perf tools: lock to protect thread list "Liang, Kan" <kan.liang@intel.com> - 2017-09-18 18:20 +0200
[PATCH RFC V2 09/10] perf top: add option to set the number of thread for event synthesize kan.liang@intel.com - 2017-09-11 04:30 +0200
RE: [PATCH RFC V2 00/10] perf top optimization "Liang, Kan" <kan.liang@intel.com> - 2017-09-13 17:30 +0200
Re: [PATCH RFC V2 00/10] perf top optimization Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-09-13 17:40 +0200
Re: [PATCH RFC V2 00/10] perf top optimization Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-09-14 23:20 +0200
RE: [PATCH RFC V2 00/10] perf top optimization "Liang, Kan" <kan.liang@intel.com> - 2017-09-15 17:20 +0200
Re: [PATCH RFC V2 00/10] perf top optimization Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-09-15 19:30 +0200
RE: [PATCH RFC V2 00/10] perf top optimization "Liang, Kan" <kan.liang@intel.com> - 2017-09-15 19:30 +0200
Re: [PATCH RFC V2 00/10] perf top optimization Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-09-15 20:30 +0200
RE: [PATCH RFC V2 00/10] perf top optimization "Liang, Kan" <kan.liang@intel.com> - 2017-09-15 20:30 +0200
Re: [PATCH RFC V2 00/10] perf top optimization Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-09-13 17:30 +0200
Re: [PATCH RFC V2 00/10] perf top optimization Jiri Olsa <jolsa@redhat.com> - 2017-09-18 11:00 +0200
Re: [PATCH RFC V2 00/10] perf top optimization Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-09-18 15:10 +0200
RE: [PATCH RFC V2 00/10] perf top optimization "Liang, Kan" <kan.liang@intel.com> - 2017-09-18 18:30 +0200
Re: [PATCH RFC V2 00/10] perf top optimization Jiri Olsa <jolsa@redhat.com> - 2017-09-19 10:20 +0200
RE: [PATCH RFC V2 00/10] perf top optimization "Liang, Kan" <kan.liang@intel.com> - 2017-09-19 14:50 +0200
Re: [PATCH RFC V2 00/10] perf top optimization Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-09-19 16:30 +0200
csiph-web