From: Jiri Olsa <jolsa@redhat.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Al Viro <viro@ZenIV.linux.org.uk>,
Tom Zanussi <tom.zanussi@linux.intel.com>,
Namhyung Kim <namhyung@kernel.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
Jiri Olsa <jolsa@kernel.org>
Subject: Re: [PATCH 3/3] tracing: Rewrite filter logic to be simpler and faster
Date: Mon, 12 Mar 2018 16:10:17 +0100 [thread overview]
Message-ID: <20180312151017.GE23111@krava> (raw)
In-Reply-To: <20180310023907.798690563@goodmis.org>
On Fri, Mar 09, 2018 at 09:34:45PM -0500, Steven Rostedt wrote:
> From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
>
> Al Viro reviewed the filter logic of ftrace trace events and found it to be
> very troubling. It creates a binary tree based on the logic operators and
> walks it during tracing. He sent myself and Tom Zanussi a long explanation
> (and formal proof) of how to do the string parsing better and end up with a
> program array that can be simply iterated to come up with the correct
> results.
>
> I took his ideas and his pseudo code and rewrote the filter logic based on
> them. In doing so, I was able to remove a lot of code, and have a much more
> condensed filter logic in the process. I wrote a very long comment
> describing the methadology that Al proposed in my own words. For more info
> on how this works, read the comment above predicate_parse().
>
> Suggested-by: Al Viro <viro@ZenIV.linux.org.uk>
> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
got it crashed when clearing the filter via 'echo > filter'
jirka
---
ibm-x3650m4-01 login: [ 803.551062] BUG: unable to handle kernel paging request at ffff972acc154c34
[ 803.558846] IP: process_preds+0x5e9/0x680
[ 803.563318] PGD 251bbf067 P4D 251bbf067 PUD 0
[ 803.568280] Oops: 0000 [#1] SMP PTI
[ 803.572172] Modules linked in: intel_rapl sb_edac x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm igb irqbypass crct10dif_pclmul ptp crc32_pclmul ipmi_ssmi_msghandler intel_rapl_perf wmi i2c_i801 mii lpc_ich xfs libcrc32c mgag200 i2c_algo_bit drm_kms_helper ttm crc32c_intel drm megaraid_sas
[ 803.618767] CPU: 13 PID: 1297 Comm: bash Not tainted 4.16.0-rc4+ #96
[ 803.625857] Hardware name: IBM System x3650 M4 : -[7915E2G]-/00Y7683, BIOS -[VVE124AUS-1.30]- 11/21/2012
[ 803.636441] RIP: 0010:process_preds+0x5e9/0x680
[ 803.641496] RSP: 0018:ffffa8aac2b9fd30 EFLAGS: 00010286
[ 803.647327] RAX: ffff972375def4e0 RBX: ffff972575b84e08 RCX: 00000000fffffffe
[ 803.655289] RDX: ffff972acc154c30 RSI: ffff972375def500 RDI: 0000000000023ee0
[ 803.663251] RBP: ffff972575b84198 R08: ffff972377be3ee0 R09: ffff972575b84210
[ 803.671213] R10: 0000000000000000 R11: 0000000040000000 R12: ffff972575b84ff0
[ 803.679176] R13: 0000000000000001 R14: 00000000fffffff4 R15: ffff972575b84ff0
[ 803.687139] FS: 00007f216a513700(0000) GS:ffff972377bc0000(0000) knlGS:0000000000000000
[ 803.696169] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 803.702581] CR2: ffff972acc154c34 CR3: 0000000274478001 CR4: 00000000000606e0
[ 803.710544] Call Trace:
[ 803.713278] create_filter+0x80/0xc0
[ 803.717268] apply_event_filter+0xb8/0x120
[ 803.721837] event_filter_write+0x5d/0xb0
[ 803.726312] __vfs_write+0x33/0x170
[ 803.730207] ? __inode_security_revalidate+0x4a/0x70
[ 803.735740] ? selinux_file_permission+0xce/0x120
[ 803.740989] ? _cond_resched+0x16/0x40
[ 803.745173] vfs_write+0xb0/0x190
[ 803.748870] SyS_write+0x52/0xc0
[ 803.752473] do_syscall_64+0x6e/0x180
[ 803.756560] entry_SYSCALL_64_after_hwframe+0x3d/0xa2
[ 803.762196] RIP: 0033:0x7f2169c00b50
[ 803.766182] RSP: 002b:00007ffc35e05db8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
[ 803.774630] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007f2169c00b50
[ 803.782592] RDX: 0000000000000001 RSI: 0000560031449e00 RDI: 0000000000000001
[ 803.790555] RBP: 0000560031449e00 R08: 00007f2169ecb740 R09: 00007f216a513700
[ 803.798517] R10: 0000560031453a00 R11: 0000000000000246 R12: 0000000000000001
[ 803.806479] R13: 0000000000000001 R14: 00007f2169eca5e0 R15: 00007f2169ec63c0
[ 803.814443] Code: 02 00 00 00 00 44 89 10 c7 40 04 00 00 00 00 83 e9 01 83 f9 ff 74 22 48 63 c1 48 c1 e0 04 48 01 f0 48 63 10 48 c1 e2 04 48 01 f2 <8b> 5a 04 39 58 04
[ 803.835544] RIP: process_preds+0x5e9/0x680 RSP: ffffa8aac2b9fd30
[ 803.842247] CR2: ffff972acc154c34
[ 803.845945] ---[ end trace 81df1915c389f53d ]---
next prev parent reply other threads:[~2018-03-12 15:10 UTC|newest]
Thread overview: 84+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-10 2:34 [PATCH 0/3] tracing: Rewrite the function filter code Steven Rostedt
2018-03-10 2:34 ` [PATCH 1/3] tracing: Combine enum and arrays into single macro in " Steven Rostedt
2018-03-12 10:31 ` Masami Hiramatsu
2018-03-10 2:34 ` [PATCH 2/3] tracing: Clean up and document pred_funcs_##type creation and use Steven Rostedt
2018-03-12 13:42 ` Masami Hiramatsu
2018-03-10 2:34 ` [PATCH 3/3] tracing: Rewrite filter logic to be simpler and faster Steven Rostedt
2018-03-10 3:10 ` Steven Rostedt
2018-03-10 3:10 ` Steven Rostedt
2018-03-10 3:15 ` Steven Rostedt
2018-03-10 3:15 ` Steven Rostedt
2018-03-10 3:22 ` Steven Rostedt
2018-03-10 3:22 ` Steven Rostedt
2018-03-10 3:18 ` Steven Rostedt
2018-03-12 12:42 ` Jiri Olsa
2018-03-12 18:38 ` Steven Rostedt
2018-03-12 15:10 ` Jiri Olsa [this message]
2018-03-12 18:40 ` Steven Rostedt
2018-03-12 18:54 ` Jiri Olsa
2018-03-12 19:10 ` Steven Rostedt
2018-03-12 23:52 ` Steven Rostedt
2018-03-13 10:14 ` Jiri Olsa
2018-03-13 14:12 ` Steven Rostedt
2018-03-13 14:27 ` Jiri Olsa
2018-03-11 19:54 ` [PATCH 0/3] tracing: Rewrite the function filter code Jiri Olsa
-- strict thread matches above, loose matches on Subject: below --
2018-03-09 20:05 [PATCH v3] kernel.h: Skip single-eval logic on literals in min()/max() Kees Cook
2018-03-09 20:05 ` Kees Cook
2018-03-09 21:10 ` Linus Torvalds
2018-03-09 21:10 ` Linus Torvalds
2018-03-09 21:47 ` Kees Cook
2018-03-09 21:47 ` Kees Cook
2018-03-11 22:46 ` Tobin C. Harding
2018-03-11 22:46 ` Tobin C. Harding
2018-03-13 13:31 ` David Laight
2018-03-13 13:31 ` David Laight
2018-03-10 0:07 ` Andrew Morton
2018-03-10 0:07 ` Andrew Morton
2018-03-10 0:28 ` Linus Torvalds
2018-03-10 0:28 ` Linus Torvalds
2018-03-10 0:32 ` Andrew Morton
2018-03-10 0:32 ` Andrew Morton
2018-03-10 0:38 ` Linus Torvalds
2018-03-10 0:38 ` Linus Torvalds
2018-03-10 1:30 ` Kees Cook
2018-03-10 1:30 ` Kees Cook
2018-03-10 1:31 ` Kees Cook
2018-03-10 1:31 ` Kees Cook
2018-03-10 2:37 ` Linus Torvalds
2018-03-10 2:37 ` Linus Torvalds
2018-03-12 22:55 ` Andrew Morton
2018-03-12 22:55 ` Andrew Morton
2018-03-12 23:57 ` Linus Torvalds
2018-03-12 23:57 ` Linus Torvalds
2018-03-13 4:28 ` Kees Cook
2018-03-13 4:28 ` Kees Cook
2018-03-13 21:02 ` Andrew Morton
2018-03-13 21:02 ` Andrew Morton
2018-03-13 22:14 ` Kees Cook
2018-03-13 22:14 ` Kees Cook
2018-03-14 11:35 ` David Laight
2018-03-14 11:35 ` David Laight
2018-03-10 3:11 ` Randy Dunlap
2018-03-10 3:11 ` Randy Dunlap
2018-03-10 6:10 ` Miguel Ojeda
2018-03-10 6:10 ` Miguel Ojeda
2018-03-10 7:03 ` Miguel Ojeda
2018-03-10 7:03 ` Miguel Ojeda
2018-03-10 16:04 ` Linus Torvalds
2018-03-10 16:04 ` Linus Torvalds
2018-03-10 15:33 ` Kees Cook
2018-03-10 15:33 ` Kees Cook
2018-03-10 16:11 ` Linus Torvalds
2018-03-10 16:11 ` Linus Torvalds
2018-03-10 16:30 ` Linus Torvalds
2018-03-10 16:30 ` Linus Torvalds
2018-03-10 17:34 ` Miguel Ojeda
2018-03-10 17:34 ` Miguel Ojeda
2018-03-10 17:51 ` Linus Torvalds
2018-03-10 17:51 ` Linus Torvalds
2018-03-10 19:08 ` Miguel Ojeda
2018-03-10 19:08 ` Miguel Ojeda
2018-03-11 11:05 ` Ingo Molnar
2018-03-11 11:05 ` Ingo Molnar
2018-03-11 18:23 ` Linus Torvalds
2018-03-11 18:23 ` Linus Torvalds
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=20180312151017.GE23111@krava \
--to=jolsa@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=rostedt@goodmis.org \
--cc=tom.zanussi@linux.intel.com \
--cc=viro@ZenIV.linux.org.uk \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.