modification_hooks: speed up calling modification hooks
commit3fbcaae91acf27cc8484457197a7403b4d61d5a6
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 28 Oct 2020 14:53:53 +0000 (28 17:53 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Wed, 28 Oct 2020 14:53:53 +0000 (28 17:53 +0300)
tree936a74558bec6cf15f2bf25b5376950e46172a68
parent256d8d5e184ddbb11a5381ecbf5d947c54e24e54
modification_hooks: speed up calling modification hooks

Doing all the strcmp()s in matches can take a long time and we might not
even have a call back for that check.  Checking for call backs first makes
parsing security/bpf/hooks.c take 83 seconds instead of 308 seconds on
my system.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch_modification_hooks.c