perf_sample_id::idx
RFC 1/1 perf_sample_id::idx
hi,
what's the perf_sample_id::idx for? It was added in here:
3c659eedada2 perf tools: Add id index
but I dont see any practical usage of it in the sources, when I remove it like below, I get clean build
any idea?
thanks,
jirka
---
tools/perf/util/event.h +1 -1
@@ -498,7 +498,7 @@ struct tracing_data_event {struct id_index_entry {u64 id; -u64 idx; +u64 idx;/* deprecated */ u64 cpu;u64 tid; };
tools/perf/util/evlist.c +3 -4
@@ -519,11 +519,11 @@ int perf_evlist__id_add_fd(struct evlist *evlist, }static void perf_evlist__set_sid_idx (struct evlist *evlist, -struct evsel *evsel,int idx,int cpu, +struct evsel *evsel,int cpu,int thread) {struct perf_sample_id *sid =SID (evsel, cpu, thread); - sid->idx = idx; +if (evlist->core.cpus && cpu >=0 ) sid->cpu = evlist->core.cpus->map[cpu];else
@@ -795,8 +795,7 @@ static int perf_evlist__mmap_per_evsel(struct evlist *evlist, int idx,if (perf_evlist__id_add_fd (evlist, evsel, cpu, thread, fd) <0 )return -1 ; -perf_evlist__set_sid_idx (evlist, evsel, idx, cpu, - thread); +perf_evlist__set_sid_idx (evlist, evsel, cpu, thread); } }
tools/perf/util/evsel.h +0 -1
@@ -23,7 +23,6 @@ struct perf_sample_id {struct hlist_node node;u64 id;struct evsel *evsel; -int idx;int cpu;pid_t tid;
tools/perf/util/session.c +1 -2
@@ -2394,7 +2394,6 @@ int perf_event__process_id_index(struct perf_session *session, sid =perf_evlist__id2sid (evlist, e->id);if (!sid)return -ENOENT ; - sid->idx = e->idx; sid->cpu = e->cpu; sid->tid = e->tid; }
@@ -2454,7 +2453,7 @@ int perf_event__synthesize_id_index(struct perf_tool *tool,return -ENOENT ; } - e->idx = sid->idx; + e->idx =-1 ; e->cpu = sid->cpu; e->tid = sid->tid; }
Hunter, Adrian
reviewerIt will be used for AUX area sampling. A sample will have AUX area data that will be queued for decoding, where there are separate queues for each CPU (per-cpu tracing) or task (per-thread tracing). The sample ID can be used to lookup 'idx' which is effectively the queue number.
Quoted 101 lines
-----Original Message-----
From: Jiri Olsa [mailto:[email protected]]
Sent: Friday, August 9, 2019 12:28 PM
To: Hunter, Adrian <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>; Ingo Molnar <[email protected]>; Namhyung Kim <[email protected]>; Alexander Shishkin <[email protected]>; Peter Zijlstra <[email protected]>; Michael Petlan <[email protected]>; linux- [email protected]
Subject: [RFC]perf_sample_id::idxhi,
what's theperf_sample_id::idxfor? It was added in here:
3c659eedada2perf tools: Add id indexbut I dont see any practical usage of it in the sources, when I remove it like below, I get clean build
any idea?
thanks,
jirka---
tools/perf/util/event.h index renamed from tools/perf/util/event.h +0
-0
70841d115349..24b90f68d616100644tools/perf/util/event.h +1
-1@@ -498,7 +498,7 @@ struct tracing_data_event {struct id_index_entry {u64 id; -u64 idx; +u64 idx;/* deprecated */ u64 cpu;u64 tid; };tools/perf/util/evlist.c index renamed from tools/perf/util/evlist.c +0
-0
c4489a1ad6bc..e55133cacb64100644tools/perf/util/evlist.c +3
-4@@ -519,11 +519,11 @@ int perf_evlist__id_add_fd(struct evlist *evlist, }static void perf_evlist__set_sid_idx (struct evlist *evlist, -struct evsel *evsel,int idx,int cpu, +struct evsel *evsel,int cpu,int thread) {struct perf_sample_id *sid =SID (evsel, cpu, thread); - sid->idx = idx; +if (evlist->core.cpus && cpu >=0 ) sid->cpu = evlist->core.cpus->map[cpu];else @@ -795,8 +795,7 @@ static int perf_evlist__mmap_per_evsel(struct evlist *evlist, int idx, if (perf_evlist__id_add_fd(evlist, evsel, cpu, thread, fd) < 0)return -1 ; -perf_evlist__set_sid_idx (evlist, evsel, idx, cpu, - thread); +perf_evlist__set_sid_idx (evlist, evsel, cpu, thread); } }tools/perf/util/evsel.h index renamed from tools/perf/util/evsel.h +0
-0
3cf35aa782b9..b9d864933d75100644tools/perf/util/evsel.h +0
-1@@ -23,7 +23,6 @@ struct perf_sample_id {struct hlist_node node;u64 id;struct evsel *evsel; -int idx;int cpu;pid_t tid;tools/perf/util/session.c index renamed from tools/perf/util/session.c +0
-0
b9fe71d11bf6..2642d60aa875100644tools/perf/util/session.c +0
-1@@ -2394,7 +2394,6 @@ int perf_event__process_id_index(structperf_session *session, sid =perf_evlist__id2sid (evlist, e->id);if (!sid)return -ENOENT ; - sid->idx = e->idx; sid->cpu = e->cpu; sid->tid = e->tid;tools/perf/util/session.c +1
-1}@@ -2454,7 +2453,7 @@ int perf_event__synthesize_id_index(struct perf_tool *tool, return -ENOENT ; } - e->idx = sid->idx; + e->idx =-1 ; e->cpu = sid->cpu; e->tid = sid->tid;}
Em Fri, Aug 09, 2019 at 03:20:14PM +0000, Hunter, Adrian escreveu:
Quoted 5 lines
It will be used for AUX area sampling. A sample will have AUX area data that will be queued for decoding, where there are separate queues for each CPU (per-cpu tracing) or task (per-thread tracing). The sample ID can be used to lookup 'idx' which is effectively the queue number.
Would be good to have this as a comment in the perf_sample_id struct definition :-)
- Arnaldo
Quoted 101 lines
Quoted 101 lines
-----Original Message-----
From: Jiri Olsa [mailto:[email protected]]
Sent: Friday, August 9, 2019 12:28 PM
To: Hunter, Adrian <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>; Ingo Molnar <[email protected]>; Namhyung Kim <[email protected]>; Alexander Shishkin <[email protected]>; Peter Zijlstra <[email protected]>; Michael Petlan <[email protected]>; linux- [email protected]
Subject: [RFC]perf_sample_id::idxhi,
what's theperf_sample_id::idxfor? It was added in here:
3c659eedada2perf tools: Add id indexbut I dont see any practical usage of it in the sources, when I remove it like below, I get clean build
any idea?
thanks,
jirka---
tools/perf/util/event.h index renamed from tools/perf/util/event.h +0
-0
70841d115349..24b90f68d616100644tools/perf/util/event.h +1
-1@@ -498,7 +498,7 @@ struct tracing_data_event {struct id_index_entry {u64 id; -u64 idx; +u64 idx;/* deprecated */ u64 cpu;u64 tid; };tools/perf/util/evlist.c index renamed from tools/perf/util/evlist.c +0
-0
c4489a1ad6bc..e55133cacb64100644tools/perf/util/evlist.c +3
-4@@ -519,11 +519,11 @@ int perf_evlist__id_add_fd(struct evlist *evlist, }static void perf_evlist__set_sid_idx (struct evlist *evlist, -struct evsel *evsel,int idx,int cpu, +struct evsel *evsel,int cpu,int thread) {struct perf_sample_id *sid =SID (evsel, cpu, thread); - sid->idx = idx; +if (evlist->core.cpus && cpu >=0 ) sid->cpu = evlist->core.cpus->map[cpu];else @@ -795,8 +795,7 @@ static int perf_evlist__mmap_per_evsel(struct evlist *evlist, int idx, if (perf_evlist__id_add_fd(evlist, evsel, cpu, thread, fd) < 0)return -1 ; -perf_evlist__set_sid_idx (evlist, evsel, idx, cpu, - thread); +perf_evlist__set_sid_idx (evlist, evsel, cpu, thread); } }tools/perf/util/evsel.h index renamed from tools/perf/util/evsel.h +0
-0
3cf35aa782b9..b9d864933d75100644tools/perf/util/evsel.h +0
-1@@ -23,7 +23,6 @@ struct perf_sample_id {struct hlist_node node;u64 id;struct evsel *evsel; -int idx;int cpu;pid_t tid;tools/perf/util/session.c index renamed from tools/perf/util/session.c +0
-0
b9fe71d11bf6..2642d60aa875100644tools/perf/util/session.c +0
-1@@ -2394,7 +2394,6 @@ int perf_event__process_id_index(structperf_session *session, sid =perf_evlist__id2sid (evlist, e->id);if (!sid)return -ENOENT ; - sid->idx = e->idx; sid->cpu = e->cpu; sid->tid = e->tid;tools/perf/util/session.c +1
-1}@@ -2454,7 +2453,7 @@ int perf_event__synthesize_id_index(struct perf_tool *tool, return -ENOENT ; } - e->idx = sid->idx; + e->idx =-1 ; e->cpu = sid->cpu; e->tid = sid->tid;}
Signature · 1 line
- Arnaldo
Adrian Hunter
reviewerQuoted 10 lines · Arnaldo Carvalho de Melo
Em Fri, Aug 09, 2019 at 03:20:14PM +0000, Hunter, Adrian escreveu:
Quoted 5 lines
It will be used for AUX area sampling. A sample will have AUX area data that will be queued for decoding, where there are separate queues for each CPU (per-cpu tracing) or task (per-thread tracing). The sample ID can be used to lookup 'idx' which is effectively the queue number.
Would be good to have this as a comment in the
perf_sample_idstruct definition :-)
From 45d57bd7b25c9864f21e25534274ea461ff83d9d Mon Sep 17 00:00:00 2001
From: Adrian Hunter <[email protected]>
Date: Mon, 12 Aug 2019 12:06:31 +0300
Subject: [PATCH] perf tools: Add comment for idx in struct perf_sample_id
'idx' was added as preparation for AUX area sampling. Add a comment to describe why.
--- tools/perf/util/evsel.h | 7 +++++++ 1 file changed, 7 insertions(+)
tools/perf/util/evsel.h +7 -0
@@ -22,6 +22,13 @@ struct perf_sample_id {struct hlist_node node;u64 id;struct perf_evsel *evsel; +/* +* 'idx' will be used for AUX area sampling. A sample will have AUX area +* data that will be queued for decoding, where there are separate +* queues for each CPU (per-cpu tracing) or task (per-thread tracing). +* The sample ID can be used to lookup 'idx' which is effectively the +* queue number. +*/ int idx;int cpu;pid_t tid;
Signature · 1 line
2.17.1
Arnaldo Carvalho de Melo
AppliedEm Mon, Aug 12, 2019 at 12:09:35PM +0300, Adrian Hunter escreveu:
Quoted 11 lines · Arnaldo Carvalho de Melo
Quoted 10 lines
Em Fri, Aug 09, 2019 at 03:20:14PM +0000, Hunter, Adrian escreveu:
Quoted 5 lines
It will be used for AUX area sampling. A sample will have AUX area data that will be queued for decoding, where there are separate queues for each CPU (per-cpu tracing) or task (per-thread tracing). The sample ID can be used to lookup 'idx' which is effectively the queue number.
Would be good to have this as a comment in the
perf_sample_idstruct definition :-)
Thanks, applied to perf/core.
Quoted 34 lines
Quoted 2 lines
From
45d57bd7b25c9864f21e25534274ea461ff83d9dMon Sep 17 00:00:00 2001From: Adrian Hunter <[email protected]>
Date: Mon, 12 Aug 2019 12:06:31 +0300
Subject: [PATCH] perf tools: Add comment for idx in structperf_sample_id'idx' was added as preparation for AUX area sampling. Add a comment to describe why.
Signed-off-by Adrian Hunter <[email protected]>--- tools/perf/util/evsel.h | 7 +++++++ 1 file changed, 7 insertions(+)tools/perf/util/evsel.h +7
-0@@ -22,6 +22,13 @@ struct perf_sample_id {struct hlist_node node;u64 id;struct perf_evsel *evsel; +/* +* 'idx' will be used for AUX area sampling. A sample will have AUX area +* data that will be queued for decoding, where there are separate +* queues for each CPU (per-cpu tracing) or task (per-thread tracing). +* The sample ID can be used to lookup 'idx' which is effectively the +* queue number. +*/ int idx;int cpu;pid_t tid;Signature · 1 line
2.17.1
Signature · 1 line
- Arnaldo
[tip: perf/core] perf evsel: Add comment for 'idx' member in 'struct perf_sample_id
In reply to Adrian HunterThe following commit has been merged into the perf/core branch of tip:
The following commit has been merged into the perf/core branch of tip:
Commit-ID: 3c84e65a533dbaa1a29bfd847deca73704b675eb Gitweb: https://git.kernel.org/tip/3c84e65a533dbaa1a29bfd847deca73704b675eb Author: Adrian Hunter <[email protected]> AuthorDate: Mon, 12 Aug 2019 12:09:35 +03:00 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitterDate: Tue, 20 Aug 2019 12:17:45 -03:00
perf evsel: Add comment for 'idx' member in 'struct perf_sample_id
The 'idx' member was added as preparation for AUX area sampling. Add a comment to describe why.
--- tools/perf/util/evsel.h | 7 +++++++ 1 file changed, 7 insertions(+)
tools/perf/util/evsel.h +7 -0
@@ -23,6 +23,13 @@ struct perf_sample_id {struct hlist_node node;u64 id;struct evsel *evsel; +/* +* 'idx' will be used for AUX area sampling. A sample will have AUX area +* data that will be queued for decoding, where there are separate +* queues for each CPU (per-cpu tracing) or task (per-thread tracing). +* The sample ID can be used to lookup 'idx' which is effectively the +* queue number. +*/ int idx;int cpu;pid_t tid;