[lkml]   [2021]   [Jan]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 2/3] perf tools: Skip MMAP record synthesis for kernel threads
On Mon, Feb 1, 2021 at 7:48 AM Jiri Olsa <> wrote:
> On Fri, Jan 29, 2021 at 02:49:00PM +0900, Namhyung Kim wrote:
> > To synthesize information to resolve sample IPs, it needs to scan task
> > and mmap info from the /proc filesystem. For each process, it
> > opens (and reads) status and maps file respectively. But as kernel
> > threads don't have memory maps so we can skip the maps file.
> >
> > To find kernel threads, check "VmPeak:" line in /proc/<PID>/status
> > file. It's about the peak virtual memory usage so only user-level
> > tasks have that. Also check "Threads:" line (which follows the VmPeak
> > line whether or not it exists) to be sure it's read enough data - just
> > in case of deeply nested pid namespaces or large number of
> > supplementary groups are involved.
> I don't understand this Threads: check, could you please
> show example where it's useful for the check?


I think there's a chance that the status file actually has the VmPeak line,
but it didn't read to the line for some reason. In that case, we should
not assume the task is a kernel thread.

So it needs to make sure whether there's no such line in the file
or it just didn't read enough data. To check the latter case, it
searches the "Threads" line which follows the VmPeak always.

Did I make it clear?


 \ /
  Last update: 2021-02-01 05:57    [W:0.065 / U:3.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site