From: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: jolsa@redhat.com, alexander.shishkin@linux.intel.com,
namhyung@kernel.org, dsahern@gmail.com, ak@linux.intel.com,
yao.jin@linux.intel.com, linux-kernel@vger.kernel.org,
Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Subject: Re: [PATCH 3/3] perf script: Fix crash because of missing feat_op[] entry
Date: Wed, 20 Jun 2018 19:39:36 +0530 [thread overview]
Message-ID: <883a0115-57f4-0bc3-9161-e5efc6a1a9d0@linux.ibm.com> (raw)
In-Reply-To: <20180620134905.GO20477@kernel.org>
Hi Arnaldo,
On 06/20/2018 07:19 PM, Arnaldo Carvalho de Melo wrote:
> Em Wed, Jun 20, 2018 at 07:00:30PM +0530, Ravi Bangoria escreveu:
>> perf_event__process_feature() tries to access feat_ops[feat].process
>> which is not defined for feat = HEADER_LAST_FEATURE and thus perf is
>> crashing. Add dummy entry for HEADER_LAST_FEATURE in the feat_ops.
>
> Humm, first impression is that we should check for HEADER_LAST_FEATURE
> and not try to access that array slot, as it is just a marker, not an
> actual feature.
Sure. Let me try to handle it inside perf_event__process_feature() itself.
May be something like below.
-----
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index 540cd2dcd3e7..4dc251d3b372 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -3461,6 +3461,10 @@ int perf_event__process_feature(struct perf_tool *tool,
return -1;
}
+ /* HEADER_LAST_FEATURE is just a marker. Ignore it. */
+ if (feat == HEADER_LAST_FEATURE)
+ return 0;
+
if (!feat_ops[feat].process)
return 0;
-----
Thanks,
Ravi
prev parent reply other threads:[~2018-06-20 14:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-20 13:30 [PATCH 0/3] perf script: Few trivial fixes Ravi Bangoria
2018-06-20 13:30 ` [PATCH 1/3] perf script: Add missing output fields in a hint Ravi Bangoria
2018-06-20 13:30 ` [PATCH 2/3] perf script: Fix crash because of missing evsel->priv Ravi Bangoria
2018-06-20 13:52 ` Arnaldo Carvalho de Melo
2018-06-20 14:00 ` Ravi Bangoria
2018-06-22 3:53 ` Ravi Bangoria
2018-06-20 13:30 ` [PATCH 3/3] perf script: Fix crash because of missing feat_op[] entry Ravi Bangoria
2018-06-20 13:49 ` Arnaldo Carvalho de Melo
2018-06-20 14:09 ` Ravi Bangoria [this message]
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=883a0115-57f4-0bc3-9161-e5efc6a1a9d0@linux.ibm.com \
--to=ravi.bangoria@linux.ibm.com \
--cc=acme@kernel.org \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=dsahern@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=namhyung@kernel.org \
--cc=yao.jin@linux.intel.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
Powered by JetHome