From: Daniel John FitzGerald <daniel.j.fitzgerald@gmail.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: perf_event sampling a multithreaded process - ioctl with PERF_EVENT_IOC_SET_OUTPUT fails
Date: Wed, 19 Apr 2017 12:51:25 -0400 [thread overview]
Message-ID: <e937e5f3-69c2-d845-8d3f-8a04b37fc177@gmail.com> (raw)
In-Reply-To: <87d101db-47df-8a4d-eb7b-9952bf0e06b8@gmail.com>
*Sighs*
I found the problem. I sent the wrong index counter as the
perf_event_open CPU... they were all being opened on different CPUs.
Thanks for the help :-)
Regards,
Dan FitzGerald
An enlightenment painter would paint a grand house on a lawn;
A romantic painter would paint it on fire.
On 04/19/2017 12:37 PM, Daniel John FitzGerald wrote:
> I'm confused as to why either would be the case; I'm specifying the same PID and same CPU number. Is there any documentation out there on all of the restrictions to PERF_EVENT_IOC_SET_OUTPUT?
>
> For reference, attached is the source for my function that calls perf_event_open(), mmaps the ring buffer, and tries to do the ioctl.
>
> Regards,
> Dan FitzGerald
>
> An enlightenment painter would paint a grand house on a lawn;
> A romantic painter would paint it on fire.
>
> On 04/19/2017 11:46 AM, Andi Kleen wrote:
>> Daniel John FitzGerald <daniel.j.fitzgerald@gmail.com> writes:
>>> The problem that I am running into is that whenever I attempt to call
>>> ioctl() with PERF_EVENT_IOC_SET_OUTPUT, I get a -1 response with
>>> errno==EINVAL.
>> There are lots of restrictions to PERF_EVENT_IOC_SET_OUTPUT.
>>
>> Likely you're violating that it has to be on the same CPU or same task.
>>
>> -Andi
prev parent reply other threads:[~2017-04-19 16:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-19 15:15 perf_event sampling a multithreaded process - ioctl with PERF_EVENT_IOC_SET_OUTPUT fails Daniel John FitzGerald
2017-04-19 15:46 ` Andi Kleen
2017-04-19 16:37 ` Daniel John FitzGerald
2017-04-19 16:51 ` Daniel John FitzGerald [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=e937e5f3-69c2-d845-8d3f-8a04b37fc177@gmail.com \
--to=daniel.j.fitzgerald@gmail.com \
--cc=andi@firstfloor.org \
--cc=linux-perf-users@vger.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;
as well as URLs for NNTP newsgroup(s).