Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171218185143.4046a71b@gandalf.local.home>
Date: Mon, 18 Dec 2017 18:51:43 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: "Tobin C. Harding" <me@...in.cc>
Cc: kernel-hardening@...ts.openwall.com, Tycho Andersen <tycho@...ho.ws>,
 Linus Torvalds <torvalds@...ux-foundation.org>, Kees Cook
 <keescook@...omium.org>, Andrew Morton <akpm@...ux-foundation.org>, Daniel
 Borkmann <daniel@...earbox.net>, Masahiro Yamada
 <yamada.masahiro@...ionext.com>, Alexei Starovoitov <ast@...nel.org>,
 linux-kernel@...r.kernel.org, Network Development <netdev@...r.kernel.org>
Subject: Re: [PATCH 3/3] trace: print address if symbol not found

On Tue, 19 Dec 2017 08:16:14 +1100
"Tobin C. Harding" <me@...in.cc> wrote:

> > >  #endif /* _LINUX_KERNEL_TRACE_H */
> > > diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c
> > > index 1e1558c99d56..3e28522a76f4 100644
> > > --- a/kernel/trace/trace_events_hist.c
> > > +++ b/kernel/trace/trace_events_hist.c
> > > @@ -982,7 +982,7 @@ static void hist_trigger_stacktrace_print(struct seq_file *m,
> > >  			return;
> > >  
> > >  		seq_printf(m, "%*c", 1 + spaces, ' ');
> > > -		sprint_symbol(str, stacktrace_entries[i]);
> > > +		trace_sprint_symbol_addr(str, stacktrace_entries[i]);  
> > 

> 
> If you have the time to give me some brief pointers on how I should go
> about testing this I'd love to test it before the next version. I know
> very little about ftrace.

For hitting the histogram stacktrace trigger (this code path), make
sure you have CONFIG_HIST_TRIGGERS enabled. And then do:

 # cd /sys/kernel/debug/tracing
 # echo 'hist:keys=common_pid.execname,stacktrace:vals=prev_state' > \
     events/sched/sched_switch/trigger
 # cat events/sched/sched_switch/hist

For the "sym" part, you can do (from the same directory):

 # echo 'hist:keys=call_site.sym:vals=bytes_req' > \
     events/kmem/kmalloc/trigger
 # cat events/kmem/kmalloc/hist


And for sym-offset:

 # echo 'hist:keys=call_site.sym-offset:vals=bytes_req' > \
    events/kmem/kmalloc/trigger
 # cat events/kmem/kmalloc/hist

-- Steve

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.