From: Jiri Olsa <jolsa@redhat.com>
To: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
Yury Norov <ynorov@caviumnetworks.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>,
Adrian Hunter <adrian.hunter@intel.com>,
Kan Liang <kan.liang@intel.com>, Wang Nan <wangnan0@huawei.com>,
Michael Ellerman <mpe@ellerman.id.au>
Subject: Re: [PATCH] tools/perf: Fix the mask in regs_dump__printf
Date: Fri, 17 Jun 2016 13:24:01 +0200 [thread overview]
Message-ID: <20160617112401.GA3904@krava> (raw)
In-Reply-To: <7abb0f9a-dea0-de86-ba0b-cebce0f11744@linux.vnet.ibm.com>
On Fri, Jun 17, 2016 at 02:43:31PM +0530, Madhavan Srinivasan wrote:
SNIP
>
>
> if (data->user_regs.abi) {
> - u64 mask = evsel->attr.sample_regs_user;
> + u.val64 = evsel->attr.sample_regs_user;
>
> - sz = hweight_long(mask) * sizeof(u64);
> + if (sizeof(u64) > sizeof(unsigned long)) {
> + u64 mask = u.val64;
> + u.val32[1] = mask >> 32;
> + u.val32[0] = mask & ULONG_MAX;
> + }
> +
> + sz = hweight_long(u.val64) * sizeof(u64);
> OVERFLOW_CHECK(array, sz, max_size);
> - data->user_regs.mask = mask;
> + data->user_regs.mask = u.val64;
> data->user_regs.regs = (u64 *)array;
>
> Issue I see is when printing the mask value in a 32bit perf
> on a 64bit kernel (big endian).
>
> 442044948492 0xdc0 [0x188]: PERF_RECORD_SAMPLE(IP, 0x1): 7299/7299:
> 0xc000000000059200 period: 12599 addr: 0
> ... intr regs: mask 0xffffffff000007ff ABI 32-bit
> ^^^ shld have been 0x7ffffffffff
>
> I agree it is better to fix this when reading, but
> we need to swap again when printing?
hum, sample data should be swap at this point already..
see perf_session__process_event
jirka
prev parent reply other threads:[~2016-06-17 11:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-17 5:22 [PATCH] tools/perf: Fix the mask in regs_dump__printf Madhavan Srinivasan
2016-06-17 6:37 ` Jiri Olsa
2016-06-17 9:13 ` Madhavan Srinivasan
2016-06-17 11:24 ` Jiri Olsa [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=20160617112401.GA3904@krava \
--to=jolsa@redhat.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.vnet.ibm.com \
--cc=mingo@redhat.com \
--cc=mpe@ellerman.id.au \
--cc=peterz@infradead.org \
--cc=wangnan0@huawei.com \
--cc=ynorov@caviumnetworks.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).