linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>, Thomas Gleixner <tglx@linutronix.de>
Cc: Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
	Clark Williams <williams@redhat.com>,
	linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Leo Yan <leo.yan@linaro.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	Mike Leach <mike.leach@linaro.org>,
	Suzuki K Poulose <suzuki.poulose@arm.com>
Subject: [PATCH 15/25] perf trace: Fix exclusion of not available syscall names from selector list
Date: Fri, 21 Jun 2019 14:38:21 -0300	[thread overview]
Message-ID: <20190621173831.13780-16-acme@kernel.org> (raw)
In-Reply-To: <20190621173831.13780-1-acme@kernel.org>

From: Arnaldo Carvalho de Melo <acme@redhat.com>

We were just skipping the syscalls not available in a particular
architecture without reflecting this in the number of entries in the
ev_qualifier_ids.nr variable, fix it.

This was done with the most minimalistic way, reusing the index variable
'i', a followup patch will further clean this by making 'i' renamed to
'nr_used' and using 'nr_allocated' in a few more places.

Reported-by: Leo Yan <leo.yan@linaro.org>
Tested-by: Leo Yan <leo.yan@linaro.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Fixes: 04c41bcb862b ("perf trace: Skip unknown syscalls when expanding strace like syscall groups")
Link: https://lkml.kernel.org/r/20190613181514.GC1402@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-trace.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 12f5ad98f8c1..fa9eb467eb4c 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -1527,9 +1527,9 @@ static int trace__read_syscall_info(struct trace *trace, int id)
 
 static int trace__validate_ev_qualifier(struct trace *trace)
 {
-	int err = 0, i;
+	int err = 0;
 	bool printed_invalid_prefix = false;
-	size_t nr_allocated;
+	size_t nr_allocated, i;
 	struct str_node *pos;
 
 	trace->ev_qualifier_ids.nr = strlist__nr_entries(trace->ev_qualifier);
@@ -1574,7 +1574,7 @@ static int trace__validate_ev_qualifier(struct trace *trace)
 			id = syscalltbl__strglobmatch_next(trace->sctbl, sc, &match_next);
 			if (id < 0)
 				break;
-			if (nr_allocated == trace->ev_qualifier_ids.nr) {
+			if (nr_allocated == i) {
 				void *entries;
 
 				nr_allocated += 8;
@@ -1587,11 +1587,11 @@ static int trace__validate_ev_qualifier(struct trace *trace)
 				}
 				trace->ev_qualifier_ids.entries = entries;
 			}
-			trace->ev_qualifier_ids.nr++;
 			trace->ev_qualifier_ids.entries[i++] = id;
 		}
 	}
 
+	trace->ev_qualifier_ids.nr = i;
 out:
 	if (printed_invalid_prefix)
 		pr_debug("\n");
-- 
2.20.1

  parent reply	other threads:[~2019-06-21 17:38 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-21 17:38 [GIT PULL] perf/core improvements and fixes Arnaldo Carvalho de Melo
2019-06-21 17:38 ` [PATCH 01/25] perf tests arm64: Compile tests unconditionally Arnaldo Carvalho de Melo
2019-06-21 17:38 ` [PATCH 02/25] perf: cs-etm: Optimize option setup for CPU-wide sessions Arnaldo Carvalho de Melo
2019-06-21 17:38 ` [PATCH 03/25] perf intel-pt: Add new packets for PEBS via PT Arnaldo Carvalho de Melo
2019-06-21 17:38 ` [PATCH 04/25] perf intel-pt: Add Intel PT packet decoder test Arnaldo Carvalho de Melo
2019-06-21 17:38 ` [PATCH 05/25] perf intel-pt: Add decoder support for PEBS via PT Arnaldo Carvalho de Melo
2019-06-21 17:38 ` [PATCH 06/25] perf intel-pt: Prepare to synthesize PEBS samples Arnaldo Carvalho de Melo
2019-06-21 17:38 ` [PATCH 07/25] perf intel-pt: Factor out common sample preparation for re-use Arnaldo Carvalho de Melo
2019-06-21 17:38 ` [PATCH 08/25] perf intel-pt: Synthesize PEBS sample basic information Arnaldo Carvalho de Melo
2019-06-21 17:38 ` [PATCH 09/25] perf intel-pt: Add gp registers to synthesized PEBS sample Arnaldo Carvalho de Melo
2019-06-21 17:38 ` [PATCH 10/25] perf intel-pt: Add XMM " Arnaldo Carvalho de Melo
2019-06-21 17:38 ` [PATCH 11/25] perf intel-pt: Add LBR information " Arnaldo Carvalho de Melo
2019-06-21 17:38 ` [PATCH 12/25] perf intel-pt: Add memory " Arnaldo Carvalho de Melo
2019-06-21 17:38 ` [PATCH 13/25] perf intel-pt: Add callchain " Arnaldo Carvalho de Melo
2019-06-21 17:38 ` [PATCH 14/25] tools build: Check if gettid() is available before providing helper Arnaldo Carvalho de Melo
2019-06-21 17:38 ` Arnaldo Carvalho de Melo [this message]
2019-06-21 17:38 ` [PATCH 16/25] perf trace: Streamline validation of select syscall names list Arnaldo Carvalho de Melo
2019-06-21 17:38 ` [PATCH 17/25] tools build feature tests: Add missing SPDX headers Arnaldo Carvalho de Melo
2019-06-21 17:38 ` [PATCH 18/25] perf " Arnaldo Carvalho de Melo
2019-06-21 17:38 ` [PATCH 19/25] perf pmu: Fix uncore PMU alias list for ARM64 Arnaldo Carvalho de Melo
2019-06-21 17:38 ` [PATCH 20/25] perf trace: Fixup pointer arithmetic when consuming augmented syscall args Arnaldo Carvalho de Melo
2019-06-21 17:38 ` [PATCH 21/25] perf evsel: Make perf_evsel__name() accept a NULL argument Arnaldo Carvalho de Melo
2019-06-21 17:38 ` [PATCH 22/25] perf tools: Don't hardcode host include path for libslang Arnaldo Carvalho de Melo
2019-06-21 17:38 ` [PATCH 23/25] tools build: Add test to check if slang.h is in /usr/include/slang/ Arnaldo Carvalho de Melo
2019-06-21 17:38 ` [PATCH 24/25] perf build: Handle slang being in /usr/include and " Arnaldo Carvalho de Melo
2019-06-21 17:38 ` [PATCH 25/25] tools build: Fix the zstd test in the test-all.c common case feature test Arnaldo Carvalho de Melo
2019-06-22  6:28 ` [GIT PULL] perf/core improvements and fixes Ingo Molnar

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=20190621173831.13780-16-acme@kernel.org \
    --to=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@kernel.org \
    --cc=leo.yan@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=mike.leach@linaro.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=suzuki.poulose@arm.com \
    --cc=tglx@linutronix.de \
    --cc=williams@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).