public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: "Jin, Yao" <yao.jin@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	acme@kernel.org, jolsa@kernel.org, mingo@redhat.com,
	alexander.shishkin@linux.intel.com, Linux-kernel@vger.kernel.org,
	ak@linux.intel.com, kan.liang@intel.com, yao.jin@intel.com,
	Will Deacon <will.deacon@arm.com>
Subject: Re: [PATCH] perf/x86/intel: Drop kernel samples even though :u is specified
Date: Mon, 22 May 2017 09:45:30 +0100	[thread overview]
Message-ID: <20170522084529.GC1478@leverpostej> (raw)
In-Reply-To: <f67248f7-1ebd-98de-ae13-5ca3920d50e5@linux.intel.com>

On Mon, May 22, 2017 at 10:12:22AM +0800, Jin, Yao wrote:
> Hi Peter,
> 
> Maybe it's not very easy to move the skid checking to generic code
> because we don't have a common kernel_ip() available to determine if
> ip is a kernel address.
> 
> I was trying to move kernel_ip() from arch/x86/events/perf_event.h
> to generic code, but some difficulties I have:
> 
> For example, in new kernel_ip(), we may use many
> conditional-compilation for all arch, for example:
> 
> #ifdef CONFIG_X86_32
>     return ip > PAGE_OFFSET;
> #endif
> 
> #ifdef CONFIG_X86_64
>     return (long)ip < 0;
> #endif
> 
> #ifdef CONFIG_ARM....
> ......
> #ifdef CONFIG_MIPS....
> ......
> 
> But the code is being ugly and hard to maintain. And frankly I don't
> know kernel address space for all arch.
> 
> Any idea? Could we just do at x86 side this time?

Can we not check user_mode(regs) for all architectures?

!user_mode(regs) implies a kernel sample.

Thanks,
Mark.

  reply	other threads:[~2017-05-22  8:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-19 10:19 [PATCH] perf/x86/intel: Drop kernel samples even though :u is specified Jin Yao
2017-05-19  9:29 ` Peter Zijlstra
2017-05-19  9:42   ` Will Deacon
2017-05-19 12:06   ` Jin, Yao
2017-05-19 12:10     ` Peter Zijlstra
2017-05-19 12:24       ` Jin, Yao
2017-05-19 12:36         ` Peter Zijlstra
2017-05-19 13:33           ` Jin, Yao
2017-05-22  2:12             ` Jin, Yao
2017-05-22  8:45               ` Mark Rutland [this message]
2017-05-22  9:26                 ` Peter Zijlstra
2017-05-22 12:30                   ` Jin, Yao

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=20170522084529.GC1478@leverpostej \
    --to=mark.rutland@arm.com \
    --cc=Linux-kernel@vger.kernel.org \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@intel.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=will.deacon@arm.com \
    --cc=yao.jin@intel.com \
    --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