From: Daniel Bristot de Oliveira <bristot@redhat.com>
To: Juri Lelli <juri.lelli@redhat.com>, Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org,
Linus Torvalds <torvalds@linux-foundation.org>,
Ingo Molnar <mingo@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Thomas Gleixner <tglx@linutronix.de>,
Peter Zijlstra <peterz@infradead.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
Tom Zanussi <tom.zanussi@linux.intel.com>,
linux-rt-users@vger.kernel.org,
linux-trace-users@vger.kernel.org,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Clark Williams <williams@redhat.com>,
Jiri Olsa <jolsa@redhat.com>, Jonathan Corbet <corbet@lwn.net>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Namhyung Kim <namhyung@kernel.org>,
Alexei Starovoitov <alexei.starovoitov@gmail.com>
Subject: Re: [PATCH 00/18] [ANNOUNCE] Dynamically created function based events
Date: Mon, 5 Feb 2018 11:49:31 +0100 [thread overview]
Message-ID: <72fc5744-d064-9d0f-bd80-127f4d665580@redhat.com> (raw)
In-Reply-To: <20180205102359.GV19535@localhost.localdomain>
On 02/05/2018 11:23 AM, Juri Lelli wrote:
> Hi Steve,
>
> On 02/02/18 18:04, Steven Rostedt wrote:
>>
>> At Kernel Summit back in October, we tried to bring up trace markers, which
>> would be nops within the kernel proper, that would allow modules to hook
>> arbitrary trace events to them. The reaction to this proposal was less than
>> favorable. We were told that we were trying to make a work around for a
>> problem, and not solving it. The problem in our minds is the notion of a
>> "stable trace event".
>>
>> There are maintainers that do not want trace events, or more trace events in
>> their subsystems. This is due to the fact that trace events post an
>> interface to user space, and this interface could become required by some
>> tool. This may cause the trace event to become stable where it must not
>> break the tool, and thus prevent the code from changing.
>>
>> Or, the trace event may just have to add padding for fields that tools
>> may require. The "success" field of the sched_wakeup trace event is one such
>> instance. There is no more "success" variable, but tools may fail if it were
>> to go away, so a "1" is simply added to the trace event wasting ring buffer
>> real estate.
>>
>> I talked with Linus about this, and he told me that we already have these
>> markers in the kernel. They are from the mcount/__fentry__ used by function
>> tracing. Have the trace events be created by these, and see if this will
>> satisfy most areas that want trace events.
>>
>> I decided to implement this idea, and here's the patch set.
>>
>> Introducing "function based events". These are created dynamically by a
>> tracefs file called "function_events". By writing a pseudo prototype into
>> this file, you create an event.
>>
>> # mount -t tracefs nodev /sys/kernel/tracing
>> # cd /sys/kernel/tracing
>> # echo 'do_IRQ(symbol ip[16] | x64[6] irq_stack[16])' > function_events
>> # cat events/functions/do_IRQ/format
>> name: do_IRQ
>> ID: 1399
>> format:
>> field:unsigned short common_type; offset:0; size:2; signed:0;
>> field:unsigned char common_flags; offset:2; size:1; signed:0;
>> field:unsigned char common_preempt_count; offset:3; size:1; signed:0;
>> field:int common_pid; offset:4; size:4; signed:1;
>>
>> field:unsigned long __parent_ip; offset:8; size:8; signed:0;
>> field:unsigned long __ip; offset:16; size:8; signed:0;
>> field:symbol ip; offset:24; size:8; signed:0;
>> field:x64 irq_stack[6]; offset:32; size:48; signed:0;
>>
>> print fmt: "%pS->%pS(ip=%pS, irq_stack=%llx:%llx:%llx:%llx:%llx:%llx)", REC->__ip, REC->__parent_ip,
>> REC->ip, REC->irq_stack[0], REC->irq_stack[1], REC->irq_stack[2], REC->irq_stack[3], REC->irq_stack[4],
>> REC->irq_stack[5]
>>
>> # echo 1 > events/functions/do_IRQ/enable
>
> Got the following:
>
> [ 110.433602] =============================
> [ 110.435671] WARNING: suspicious RCU usage
> [ 110.437173] 4.15.0-rc9+ #42 Not tainted
> [ 110.438698] -----------------------------
> [ 110.440343] /home/juri/Work/kernel/linux/include/linux/rcupdate.h:749 rcu_read_lock_sched() used illegally while idle!
> [ 110.444480]
> [ 110.444480] other info that might help us debug this:
> [ 110.444480]
> [ 110.447616]
> [ 110.447616] RCU used illegally from idle CPU!
> [ 110.447616] rcu_scheduler_active = 2, debug_locks = 1
> [ 110.452047] RCU used illegally from extended quiescent state!
> [ 110.454072] 1 lock held by swapper/0/0:
> [ 110.455447] #0: (rcu_read_lock_sched){....}, at: [<00000000de240ad4>] func_event_call+0x0/0x3c0
> [ 110.458532]
> [ 110.458532] stack backtrace:
> [ 110.460066] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.15.0-rc9+ #42
> [ 110.462300] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-2.fc27 04/01/2014
> [ 110.464477] Call Trace:
> [ 110.465095] <IRQ>
> [ 110.465600] dump_stack+0x85/0xc5
> [ 110.466417] func_event_call+0x378/0x3c0
> [ 110.467373] ? find_held_lock+0x34/0xa0
> [ 110.468216] ? common_interrupt+0xa2/0xa2
> [ 110.468978] ? irq_work_interrupt+0xb0/0xb0
> [ 110.470021] ? hrtimer_start_range_ns+0x1bf/0x3e0
> [ 110.471031] ftrace_ops_assist_func+0x64/0xf0
> [ 110.471941] ? _raw_spin_unlock_irqrestore+0x55/0x60
> [ 110.472926] 0xffffffffc02e30bf
> [ 110.473491] ? do_IRQ+0x5/0x100
> [ 110.473977] do_IRQ+0x5/0x100
> [ 110.474430] common_interrupt+0xa2/0xa2
> [ 110.475014] </IRQ>
> [ 110.475341] RIP: 0010:native_safe_halt+0x2/0x10
> [ 110.476020] RSP: 0018:ffffffff96a03ec8 EFLAGS: 00000206 ORIG_RAX: ffffffffffffffdd
> [ 110.477137] RAX: ffffffff96a2a500 RBX: 0000000000000000 RCX: 0000000000000000
> [ 110.478110] RDX: ffffffff96a2a500 RSI: 0000000000000001 RDI: ffffffff96a2a500
> [ 110.478997] RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000000
> [ 110.479880] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
> [ 110.480764] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
> [ 110.481661] default_idle+0x1f/0x1a0
> [ 110.482118] do_idle+0x166/0x1e0
> [ 110.482530] cpu_startup_entry+0x19/0x20
> [ 110.482985] start_kernel+0x40a/0x412
> [ 110.483385] secondary_startup_64+0xa5/0xb0
Isn't this the case of calling tracing functions before calling:
rcu_irq_enter();
?
-- Daniel
>
> continuing to test this. :)
>
> Thanks,
>
> - Juri
>
next prev parent reply other threads:[~2018-02-05 10:49 UTC|newest]
Thread overview: 84+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-02 23:04 Steven Rostedt
2018-02-02 23:04 ` [PATCH 01/18] tracing: Add " Steven Rostedt
2018-02-05 8:24 ` Jiri Olsa
2018-02-05 15:00 ` Steven Rostedt
2018-02-07 3:09 ` Steven Rostedt
2018-02-07 12:06 ` Jiri Olsa
2018-02-02 23:05 ` [PATCH 02/18] tracing: Add documentation for " Steven Rostedt
2018-02-02 23:05 ` [PATCH 03/18] tracing: Add simple arguments to " Steven Rostedt
2018-02-08 10:18 ` Namhyung Kim
2018-02-08 15:37 ` Steven Rostedt
2018-02-02 23:05 ` [PATCH 04/18] tracing/x86: Add arch_get_func_args() function Steven Rostedt
2018-02-05 16:33 ` Masami Hiramatsu
2018-02-05 17:06 ` Steven Rostedt
2018-02-08 5:28 ` Namhyung Kim
2018-02-08 15:29 ` Steven Rostedt
2018-02-02 23:05 ` [PATCH 05/18] tracing: Add hex print for dynamic ftrace based events Steven Rostedt
2018-02-02 23:05 ` [PATCH 06/18] tracing: Add indirect offset to args of " Steven Rostedt
2018-02-02 23:05 ` [PATCH 07/18] tracing: Add dereferencing multiple fields per arg Steven Rostedt
2018-02-02 23:05 ` [PATCH 08/18] tracing: Add "unsigned" to function based events Steven Rostedt
2018-02-02 23:05 ` [PATCH 09/18] tracing: Add indexing of arguments for " Steven Rostedt
2018-02-08 10:59 ` Namhyung Kim
2018-02-08 15:43 ` Steven Rostedt
2018-02-08 23:56 ` Namhyung Kim
2018-02-09 0:19 ` Steven Rostedt
2018-02-02 23:05 ` [PATCH 10/18] tracing: Make func_type enums for easier comparing of arg types Steven Rostedt
2018-02-02 23:05 ` [PATCH 11/18] tracing: Add symbol type to function based events Steven Rostedt
2018-02-08 11:03 ` Namhyung Kim
2018-02-08 15:48 ` Steven Rostedt
2018-02-02 23:05 ` [PATCH 12/18] tracing: Add accessing direct address from " Steven Rostedt
2018-02-09 0:34 ` Namhyung Kim
2018-02-09 1:10 ` Steven Rostedt
2018-02-09 22:07 ` Steven Rostedt
2018-02-12 2:06 ` Namhyung Kim
2018-02-12 15:47 ` Masami Hiramatsu
2018-02-12 16:47 ` Steven Rostedt
2018-02-02 23:05 ` [PATCH 13/18] tracing: Add array type to " Steven Rostedt
2018-02-03 13:56 ` Masami Hiramatsu
2018-02-03 15:29 ` Steven Rostedt
2018-02-04 3:50 ` Masami Hiramatsu
2018-02-09 1:17 ` Namhyung Kim
2018-02-09 1:54 ` Steven Rostedt
2018-02-02 23:05 ` [PATCH 14/18] tracing: Have char arrays be strings for " Steven Rostedt
2018-02-02 23:05 ` [PATCH 15/18] tracing: Add string type for dynamic strings in " Steven Rostedt
2018-02-09 3:15 ` Namhyung Kim
2018-02-09 3:31 ` Steven Rostedt
2018-02-02 23:05 ` [PATCH 16/18] tracing: Add NULL to skip args for " Steven Rostedt
2018-02-02 23:05 ` [PATCH 17/18] tracing: Add indirect to indirect access " Steven Rostedt
2018-02-09 5:13 ` Namhyung Kim
2018-02-09 15:47 ` Steven Rostedt
2018-02-09 17:18 ` Steven Rostedt
2018-02-12 2:15 ` Namhyung Kim
2018-02-12 17:23 ` Steven Rostedt
2018-02-13 9:27 ` Namhyung Kim
2018-02-13 15:28 ` Steven Rostedt
2018-02-02 23:05 ` [PATCH 18/18] tracing/perf: Allow perf to use " Steven Rostedt
2018-02-03 13:38 ` [PATCH 00/18] [ANNOUNCE] Dynamically created " Masami Hiramatsu
2018-02-03 15:27 ` Steven Rostedt
2018-02-04 3:57 ` Masami Hiramatsu
2018-02-04 17:21 ` Alexei Starovoitov
2018-02-05 14:39 ` Masami Hiramatsu
2018-02-03 17:04 ` Mathieu Desnoyers
2018-02-03 19:02 ` Steven Rostedt
2018-02-03 20:52 ` Alexei Starovoitov
2018-02-03 21:08 ` Steven Rostedt
2018-02-03 21:30 ` Alexei Starovoitov
2018-02-04 2:37 ` Namhyung Kim
2018-02-04 15:50 ` Mathieu Desnoyers
2018-02-03 21:17 ` Steven Rostedt
2018-02-03 21:38 ` Alexei Starovoitov
2018-02-04 2:25 ` Namhyung Kim
2018-02-05 15:02 ` Steven Rostedt
2018-02-05 13:53 ` Juri Lelli
2018-02-05 15:07 ` Steven Rostedt
2018-02-03 21:43 ` Linus Torvalds
2018-02-04 15:30 ` Mathieu Desnoyers
2018-02-04 15:47 ` Steven Rostedt
2018-02-04 19:39 ` Linus Torvalds
2018-02-05 10:09 ` Peter Zijlstra
2018-02-05 15:10 ` Steven Rostedt
2018-02-05 15:14 ` Masami Hiramatsu
2018-02-03 18:52 ` Steven Rostedt
2018-02-05 10:23 ` Juri Lelli
2018-02-05 10:49 ` Daniel Bristot de Oliveira [this message]
2018-02-05 15:11 ` Steven Rostedt
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=72fc5744-d064-9d0f-bd80-127f4d665580@redhat.com \
--to=bristot@redhat.com \
--cc=acme@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=alexei.starovoitov@gmail.com \
--cc=corbet@lwn.net \
--cc=jolsa@redhat.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=linux-trace-users@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=tom.zanussi@linux.intel.com \
--cc=torvalds@linux-foundation.org \
--cc=williams@redhat.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
all inboxes | Powered by JetHome®