This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
On Tue, 26 Feb 2008 14:38:48 -0800 "David J. Wilder" <dwilder@us.ibm.com> wrote:
+ if (strncmp(buf, "start", strlen("start")) == 0) { + ret = trace_start(trace); + if (ret) + return ret; + } else if (strncmp(buf, "stop", strlen("stop")) == 0) + trace_stop(trace);
Does gcc manage to avoid the pointless strlen() calls here?
It's a bit untidy that you can write "startfoo" in there and the kernel will happily accept it.
if (strcmp(buf, "start") == 0) { ret = trace_start(trace); if (ret) return ret; } else if (strcmp(buf, "stop") == 0) trace_stop(trace); else return -EINVAL;
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |