Skip to contentSkip to conversation

tracing/filters: Provide basic regex support

tip:tracing/core Steven Rostedt 2 participants 2 messages Sep 26, 2009 – Sep 28, 2009 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 18 lines · tip-bot for Frederic Weisbecker
Commit-ID:  1889d20922d14a97b2099fa4d47587217c0ba48b
Gitweb:     http://git.kernel.org/tip/1889d20922d14a97b2099fa4d47587217c0ba48b
Author:     Frederic Weisbecker <[email protected]>
AuthorDate: Thu, 24 Sep 2009 21:10:44 +0200
Committer:  Frederic Weisbecker <[email protected]>
CommitDate: Thu, 24 Sep 2009 21:39:27 +0200

tracing/filters: Provide basic regex support

This patch provides basic support for regular expressions in filters.

It supports the following types of regexp:

- *match_beginning
- *match_middle*
- match_end*
- !don't match

Quoted 4 lines

Example:

	cd /debug/tracing/events/bkl/lock_kernel
	echo 'file == "*reiserfs*"' > filter
	echo 1 > enable

Darn! I need to keep up with my email more. Someone asked me at my ftrace tutorial if the filters can take regex's. I told them that I don't think so. Of course, my tutorial was on 2.6.31 so I was still correct. But it would have been nice if I told them that it will in 2.6.32 or 33.

-- Steve

Quoted 14 lines
           gedit-4941  [000]   457.735437: lock_kernel: depth: 0, fs/reiserfs/namei.c:334 reiserfs_lookup()
     sync_supers-227   [001]   461.379985: lock_kernel: depth: 0, fs/reiserfs/super.c:69 reiserfs_sync_fs()
     sync_supers-227   [000]   461.383096: lock_kernel: depth: 0, fs/reiserfs/journal.c:1069 flush_commit_list()
      reiserfs/1-1369  [001]   461.479885: lock_kernel: depth: 0, fs/reiserfs/journal.c:3509 flush_async_commits()

Every string is now handled as a regexp in the filter framework, which helps to factorize the code for handling both simple strings and regexp comparisons.

(The regexp parsing code has been wildly cherry picked from ftrace.c written by Steve.)

v2: Simplify the whole and drop the filter_regex file

#2 lore raw
Quoted 25 lines · Steven Rostedt
Quoted 18 lines · tip-bot for Frederic Weisbecker
Commit-ID:  1889d20922d14a97b2099fa4d47587217c0ba48b
Gitweb:     http://git.kernel.org/tip/1889d20922d14a97b2099fa4d47587217c0ba48b
Author:     Frederic Weisbecker <[email protected]>
AuthorDate: Thu, 24 Sep 2009 21:10:44 +0200
Committer:  Frederic Weisbecker <[email protected]>
CommitDate: Thu, 24 Sep 2009 21:39:27 +0200

tracing/filters: Provide basic regex support

This patch provides basic support for regular expressions in filters.

It supports the following types of regexp:

- *match_beginning
- *match_middle*
- match_end*
- !don't match

Quoted 4 lines

Example:

	cd /debug/tracing/events/bkl/lock_kernel
	echo 'file == "*reiserfs*"' > filter
	echo 1 > enable
Quoted 7 lines

Darn! I need to keep up with my email more. Someone asked me at my ftrace tutorial if the filters can take regex's. I told them that I don't think so. Of course, my tutorial was on 2.6.31 so I was still correct. But it would have been nice if I told them that it will in 2.6.32 or 33.

-- Steve

Hehe :-)

That said I guess it should be more for .33 than .32 I guess.