You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BEGIN {
$i = 0;
while ($i < 100) {
@m[1] += 1;
$i++;
if ($i == 100) {
exit();
}
}
}
END {
for ($kv : @m) {
print(($kv));
}
clear(@m);
}
This script seems to always exit with the correct output, namely: (1, 100).
However if you use the count() function instead of +=1, which is functionally equivalent, I often see this as the output: (1,0).
My guess is that because the map used for count is BPF_MAP_TYPE_PERCPU_HASH vs BPF_MAP_TYPE_HASH used for the += operation, there is some issue there but that's as far as I got.
The text was updated successfully, but these errors were encountered:
This script seems to always exit with the correct output, namely:
(1, 100)
.However if you use the
count()
function instead of+=1
, which is functionally equivalent, I often see this as the output:(1,0)
.My guess is that because the map used for
count
isBPF_MAP_TYPE_PERCPU_HASH
vsBPF_MAP_TYPE_HASH
used for the+=
operation, there is some issue there but that's as far as I got.The text was updated successfully, but these errors were encountered: