[PATCH v3] Implement -e trace=/regex option

Dmitry V. Levin ldv at altlinux.org
Thu Apr 13 14:45:46 UTC 2017


On Thu, Apr 13, 2017 at 09:33:06AM +0800, JingPiao Chen wrote:
> On Thu, Apr 13, 2017 at 5:10 AM, Dmitry V. Levin wrote:
> >On Wed, Apr 12, 2017 at 09:31:51PM +0800, JingPiao Chen wrote:
> >> @@ -198,6 +199,48 @@ qualify_syscall_number(const char *s, struct
> number_set *set)
> >>   return done;
> >>  }
> >>
> >> +static bool
> >> +qualify_syscall_regex(const char *s, struct number_set *set)
> >> +{
> >> + regex_t preg;
> >> + int rc;
> >> +
> >> + if ((rc = regcomp(&preg, s, REG_EXTENDED | REG_NOSUB)) != 0) {
> >> + size_t len = regerror(rc, &preg, NULL, 0);
> >> + char buf[len];
> >
> >We don't use VLA on the stack, it is not portable.  In particular,
> >it won't pass travis-ci clang tests.  If you've pushed it to github
> >and enabled travis-ci, you'd have noticed.
> 
> Ok, I replace it with alloca. But it pass travis-ci clang tests [1],

Well, I'm surprised.

> and strace have similar code in socketutils.c:152.

It's not quite similar, there are two constant values there.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20170413/3f23b354/attachment.bin>


More information about the Strace-devel mailing list