linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: zhangmengting <zhangmengting@huawei.com>
Cc: namhyung@kernel.org, alexander.shishkin@linux.intel.com,
	acme@kernel.org, Linux-kernel@vger.kernel.org,
	linux-perf-users@vger.kernel.org, huawei.libin@huawei.com,
	wangnan0@huawei.com
Subject: Re: [PATCH] perf parse events: Fix invalid precise_ip handling
Date: Tue, 21 Nov 2017 16:23:57 +0100	[thread overview]
Message-ID: <20171121152357.GN20440@krava> (raw)
In-Reply-To: <1a249a21-5e93-7434-8b6f-08241513dceb@huawei.com>

On Tue, Nov 21, 2017 at 04:30:09PM +0800, zhangmengting wrote:

SNIP

> > > > also I think the precise level is not generic for all the events,
> > > > so you should check it for specific perf_event_attr later, when
> > > > the attr is ready, not in modifier parsing
> > > You are right, and I would check it for specific perf_event_attr.
> > > 
> > > BTW, I have a question. If the user-specified precise_ip is greater than the
> > > max precise_ip, I wonder
> > > whether it is better to adjust the user-specified precise_ip to the maximum
> > > available.
> > no, I think that user defined precise level should stay the
> > way the user wants it.. we don't want more angry users ;-)
> 
> Humm, I am sorry for being unclear.
> If the user defined precise level is greater than the max precise level,
> I think there are two ways to deal with it.
> 1.  return EINVAL to indicate the invalid precise_ip setting;

and warn user about the reason

> 2.  adjust to the max precise level available and give message to indicate
> the adjustment.

we do that (or should) only if the precise_ip is not defined by user
because we want the max precise level by default

> Since we should check user-defined precise level in perf_evsel__config(),
> when the attr is ready, I think there is a problem with method 1, if we keep
> the
> user defined precise level stay the way the user wants it.
> 
> With method 1, we have to let perf_evsel__config() return value and show
> errno.
> And this change will affect many related functions, such as
> perf_evlist__config(), and files.
> 
> With method 2, we don't need to change the return type of
> perf_evsel__config().
> 
> Am I right?

not sure.. let's discuss over the code changes

jirka

      reply	other threads:[~2017-11-21 15:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-10  8:28 [PATCH] perf parse events: Fix invalid precise_ip handling Mengting Zhang
2017-11-10 10:39 ` Jiri Olsa
2017-11-15  1:00   ` zhangmengting
2017-11-20  7:33     ` Jiri Olsa
2017-11-21  8:30       ` zhangmengting
2017-11-21 15:23         ` 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=20171121152357.GN20440@krava \
    --to=jolsa@redhat.com \
    --cc=Linux-kernel@vger.kernel.org \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=huawei.libin@huawei.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=namhyung@kernel.org \
    --cc=wangnan0@huawei.com \
    --cc=zhangmengting@huawei.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).