linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] perf_sample_id::idx
@ 2019-08-09  9:27 Jiri Olsa
  2019-08-09 15:20 ` Hunter, Adrian
  0 siblings, 1 reply; 6+ messages in thread
From: Jiri Olsa @ 2019-08-09  9:27 UTC (permalink / raw)
  To: Adrian Hunter
  Cc: Arnaldo Carvalho de Melo, Ingo Molnar, Namhyung Kim,
	Alexander Shishkin, Peter Zijlstra, Michael Petlan, linux-kernel

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


---
diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h
index 70841d115349..24b90f68d616 100644
--- a/tools/perf/util/event.h
+++ b/tools/perf/util/event.h
@@ -498,7 +498,7 @@ struct tracing_data_event {
 
 struct id_index_entry {
 	u64 id;
-	u64 idx;
+	u64 idx; /* deprecated */
 	u64 cpu;
 	u64 tid;
 };
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index c4489a1ad6bc..e55133cacb64 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -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);
 		}
 	}
 
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index 3cf35aa782b9..b9d864933d75 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -23,7 +23,6 @@ struct perf_sample_id {
 	struct hlist_node 	node;
 	u64		 	id;
 	struct evsel		*evsel;
-	int			idx;
 	int			cpu;
 	pid_t			tid;
 
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index b9fe71d11bf6..2642d60aa875 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -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;
 		}

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-08-23  2:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-09  9:27 [RFC] perf_sample_id::idx Jiri Olsa
2019-08-09 15:20 ` Hunter, Adrian
2019-08-09 16:04   ` Arnaldo Carvalho de Melo
2019-08-12  9:09     ` Adrian Hunter
2019-08-19 14:30       ` Arnaldo Carvalho de Melo
2019-08-23  2:44       ` [tip: perf/core] perf evsel: Add comment for 'idx' member in 'struct perf_sample_id tip-bot2 for Adrian Hunter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).