-
Notifications
You must be signed in to change notification settings - Fork 629
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
operator: add an operator to query the interval table
Signed-off-by: Masatake YAMATO <yamato@redhat.com> (cherry picked from commit 2256ddf)
- Loading branch information
Showing
4 changed files
with
200 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
--sort=no | ||
|
||
--langdef=Foo{base=C}{shared} | ||
--fields=+lr | ||
--extras=+r | ||
|
||
--kinddef-Foo=r,readhandler,read handlers | ||
--kinddef-Foo=m,method,methods | ||
--_roledef-Foo.m=set,set a handler | ||
--kinddef-Foo=w,writehandler,write handlers | ||
--kinddef-Foo=s,seekhandler,seek handlers | ||
--kinddef-Foo=o,openhandler,open handlers | ||
--kinddef-Foo=R,releasehandler,release handlers | ||
|
||
# tag:int | ||
--regex-Foo=/= ([a-z_]*_read),//{postrun}{{ | ||
\1 /readhandler _tag _commit dup | ||
_intervaltab { | ||
scope: | ||
} { | ||
pop | ||
} ifelse | ||
}} | ||
|
||
# tag:tag | ||
--regex-Foo=/\.([a-z_]+)[ \t]*=//{postrun}{{ | ||
\1 /method /set _reftag dup | ||
_intervaltab { | ||
exch _commit exch scope: | ||
} { | ||
_commit | ||
} ifelse | ||
}} | ||
|
||
# matchloc | ||
--regex-Foo=/= ([a-z_]*_write),//{postrun}{{ | ||
\1 /writehandler _tag _commit | ||
@1 _intervaltab { | ||
scope: | ||
} { | ||
pop | ||
} ifelse | ||
}} | ||
|
||
--regex-Foo=/= ([a-z_]*_l?lseek),//{postrun}{{ | ||
\1 /seekhandler _tag _commit | ||
1@ _intervaltab { | ||
scope: | ||
} { | ||
pop | ||
} ifelse | ||
}} | ||
|
||
# [line:int] | ||
--regex-Foo=/= ([a-z_]*_release),//{postrun}{{ | ||
\1 /releasehandler _tag _commit | ||
[ 1@ _matchloc2line ] _intervaltab { | ||
scope: | ||
} { | ||
pop | ||
} ifelse | ||
}} | ||
|
||
# [startline:int endline:int] | ||
--regex-Foo=/= ([a-z_]*_open)(,)//{postrun}{{ | ||
\1 /openhandler _tag _commit | ||
[ 1@ _matchloc2line @2 _matchloc2line ] _intervaltab { | ||
scope: | ||
} { | ||
pop | ||
} ifelse | ||
}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
proc_pid_cmdline_ops input.c /^static const struct file_operations proc_pid_cmdline_ops = {$/;" v language:C typeref:typename:const struct file_operations file: roles:def | ||
proc_lstats_operations input.c /^static const struct file_operations proc_lstats_operations = {$/;" v language:C typeref:typename:const struct file_operations file: roles:def | ||
proc_single_file_operations input.c /^static const struct file_operations proc_single_file_operations = {$/;" v language:C typeref:typename:const struct file_operations file: roles:def | ||
proc_pid_cmdline_read input.c /^ .read = proc_pid_cmdline_read,$/;" r language:Foo variable:proc_pid_cmdline_ops roles:def | ||
read input.c /^ .read = proc_pid_cmdline_read,$/;" m language:Foo variable:proc_pid_cmdline_ops roles:set | ||
llseek input.c /^ .llseek = generic_file_llseek,$/;" m language:Foo variable:proc_pid_cmdline_ops roles:set | ||
generic_file_llseek input.c /^ .llseek = generic_file_llseek,$/;" s language:Foo variable:proc_pid_cmdline_ops roles:def | ||
open input.c /^ .open = lstats_open,$/;" m language:Foo variable:proc_lstats_operations roles:set | ||
lstats_open input.c /^ .open = lstats_open,$/;" o language:Foo variable:proc_lstats_operations roles:def | ||
seq_read input.c /^ .read = seq_read,$/;" r language:Foo variable:proc_lstats_operations roles:def | ||
read input.c /^ .read = seq_read,$/;" m language:Foo variable:proc_lstats_operations roles:set | ||
write input.c /^ .write = lstats_write,$/;" m language:Foo variable:proc_lstats_operations roles:set | ||
lstats_write input.c /^ .write = lstats_write,$/;" w language:Foo variable:proc_lstats_operations roles:def | ||
llseek input.c /^ .llseek = seq_lseek,$/;" m language:Foo variable:proc_lstats_operations roles:set | ||
seq_lseek input.c /^ .llseek = seq_lseek,$/;" s language:Foo variable:proc_lstats_operations roles:def | ||
release input.c /^ .release = single_release,$/;" m language:Foo variable:proc_lstats_operations roles:set | ||
single_release input.c /^ .release = single_release,$/;" R language:Foo variable:proc_lstats_operations roles:def | ||
open input.c /^ .open = proc_single_open,$/;" m language:Foo variable:proc_single_file_operations roles:set | ||
proc_single_open input.c /^ .open = proc_single_open,$/;" o language:Foo variable:proc_single_file_operations roles:def | ||
seq_read input.c /^ .read = seq_read,$/;" r language:Foo variable:proc_single_file_operations roles:def | ||
read input.c /^ .read = seq_read,$/;" m language:Foo variable:proc_single_file_operations roles:set | ||
llseek input.c /^ .llseek = seq_lseek,$/;" m language:Foo variable:proc_single_file_operations roles:set | ||
seq_lseek input.c /^ .llseek = seq_lseek,$/;" s language:Foo variable:proc_single_file_operations roles:def | ||
release input.c /^ .release = single_release,$/;" m language:Foo variable:proc_single_file_operations roles:set | ||
single_release input.c /^ .release = single_release,$/;" R language:Foo variable:proc_single_file_operations roles:def |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* Taken from Linux (fs/proc/base.c) */ | ||
|
||
static const struct file_operations proc_pid_cmdline_ops = { | ||
.read = proc_pid_cmdline_read, | ||
.llseek = generic_file_llseek, | ||
}; | ||
|
||
static const struct file_operations proc_lstats_operations = { | ||
.open = lstats_open, | ||
.read = seq_read, | ||
.write = lstats_write, | ||
.llseek = seq_lseek, | ||
.release = single_release, | ||
}; | ||
|
||
static const struct file_operations proc_single_file_operations = { | ||
.open = proc_single_open, | ||
.read = seq_read, | ||
.llseek = seq_lseek, | ||
.release = single_release, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters