lkml.org 
[lkml]   [2015]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v6 tip 3/8] tracing: allow BPF programs to call bpf_ktime_get_ns()
On 3/13/15 4:24 AM, He Kuang wrote:
> Hi, Alexei
>
> I've followed up your bpf version. In bpf filter, sometimes we need to
> get 'pid' and some other context informations to decide whether to
> filter or not.
>
> For example, to trace a vfs read procedure, we can insert bpf program to
> '__vfs_read(struct file *file, char __user *buf ...)', mark some of
> 'buf' addresses and only trace the read procedure of these 'buf's. But
> this parameter is a userspace pointer, the value is meaningless to other
> processes, so we should also record 'pid' to make sense.
>
> To a function like __vfs_read, 'pid' can't be extracted from function
> parameters directly. What's your opinion on this issue?

yes. it's the next thing on todo list after this set of patches.
There are several ways to let programs see 'pid'. We'll debate about
the best approach hopefully soon :)


\
 
 \ /
  Last update: 2015-03-13 18:01    [W:0.036 / U:9.676 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site