public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Adrian Hunter <adrian.hunter@intel.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Michael Petlan <mpetlan@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: [RFC] perf_sample_id::idx
Date: Fri, 9 Aug 2019 11:27:36 +0200	[thread overview]
Message-ID: <20190809092736.GA9377@krava> (raw)

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;
 		}

             reply	other threads:[~2019-08-09  9:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-09  9:27 Jiri Olsa [this message]
2019-08-09 15:20 ` [RFC] perf_sample_id::idx 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190809092736.GA9377@krava \
    --to=jolsa@redhat.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mpetlan@redhat.com \
    --cc=namhyung@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox