Working on -e trace
Dmitry V. Levin
ldv at altlinux.org
Wed Mar 9 23:54:52 UTC 2016
On Wed, Mar 09, 2016 at 11:02:52AM +0530, haris iqbal wrote:
[...]
> Sorry for the multiple commits. My vim is giving trouble.
Please don't send incremental commits, just amend and send the one you
already have.
> >> @@ -264,8 +264,8 @@
> >> [271] = { 6, 0, SEN(process_vm_writev),
> >> "process_vm_writev" },
> >> [272] = { 5, 0, SEN(kcmp), "kcmp" },
> >> [273] = { 3, TD, SEN(finit_module), "finit_module" },
> >> -[274] = { 3, 0, SEN(sched_setattr), "sched_setattr" },
> >> -[275] = { 4, 0, SEN(sched_getattr), "sched_getattr" },
> >> +[274] = { 3, TSC, SEN(sched_setattr),
> >> "sched_setattr" },
> >> +[275] = { 4, TSC, SEN(sched_getattr),
> >> "sched_getattr" },
> >> [276] = { 5, TD|TF, SEN(renameat2), "renameat2" },
> >> [277] = { 3, 0, SEN(seccomp), "seccomp", },
> >> [278] = { 3, 0, SEN(getrandom), "getrandom", },
> >
> > I assume all changes to syscallent files were made by some simple script.
> > Please include this script into commit message.
>
> The python script that I used was
>
> import os
> rootdir = '/home/student/junk/test_strace'
>
> seperator = ','
> for subdir, dirs, files in os.walk(rootdir):
> for file in files:
> temp = os.path.join(subdir, file)
> if(temp.find("syscallent") != -1):
> print
> "------------------------------------------------------------------\n"
> print temp
>
> with open(temp, 'r') as file:
> lines = file.readlines()
>
> for i in range(len(lines)):
> if(lines[i].find("sched") != -1):
> print lines[i]
> parts = lines[i].split(seperator)
>
> parts[1] = '\tTSC'
>
> lines[i] = seperator.join(parts)
> print lines[i]
>
>
> with open(temp, 'w') as file:
> file.writelines( lines )
I've checked that
git grep -Fl 'SEN(sched_' linux/ |xargs sed -i 's/0\(,[[:space:]]*SEN(sched_\)/TSC\1/'
produces exactly the same result as your patch.
I'd say my sed script is a bit simpler than your python script, though. ;)
> >> --- a/syscall.c
> >> +++ b/syscall.c
> >> @@ -78,6 +78,7 @@
> >> #define TP TRACE_PROCESS
> >> #define TS TRACE_SIGNAL
> >> #define TM TRACE_MEMORY
> >> +#define TSC TRACE_SCHED
> >> #define NF SYSCALL_NEVER_FAILS
> >> #define MA MAX_ARGS
> >> #define SI STACKTRACE_INVALIDATE_CACHE
> >> @@ -500,6 +501,8 @@ lookup_class(const char *s)
> >> return TRACE_DESC;
> >> if (strcmp(s, "memory") == 0)
> >> return TRACE_MEMORY;
> >> + if (strcmp(s, "scheduler") == 0)
> >> + return TRACE_SCHED;
> >> return -1;
> >> }
> >
> > Please follow the indentation style.
> > BTW, why "scheduler"? Could you give a rationale for this name?
>
> I thought as all the system calls are one or the other related to the
> scheduler. We can also consider the description "syscalls relate to
> scheduling.
There is a subtle difference between a scheduler (an actor) and a set
of syscalls related to scheduling (an action) than might lead to confusion
in the future. That's why I still think that "%sched" would be better in
long run than "scheduler" or "scheduling".
Anyway, a user-visible change like this has to be properly documented with
an entry in strace.1 and a line in NEWS file.
--
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20160310/1d336c19/attachment.bin>
More information about the Strace-devel
mailing list