tools: replace add with xadd (#3518)
resolve #3481
replace add with xadd for more tools.
diff --git a/tools/inject.py b/tools/inject.py
index 9d6b85f..320b393 100755
--- a/tools/inject.py
+++ b/tools/inject.py
@@ -225,7 +225,7 @@
* If this is the only call in the chain and predicate passes
*/
if (%s == 1 && %s && overridden < %s) {
- count.increment(zero);
+ count.atomic_increment(zero);
bpf_override_return(ctx, %s);
return 0;
}
@@ -240,7 +240,7 @@
* If all conds have been met and predicate passes
*/
if (p->conds_met == %s && %s && overridden < %s) {
- count.increment(zero);
+ count.atomic_increment(zero);
bpf_override_return(ctx, %s);
}
return 0;