/* rcu ptr define/use in different regions */
task = bpf_get_current_task_btf();
bpf_rcu_read_lock();
real_parent = task->real_parent;
bpf_rcu_read_unlock();
bpf_rcu_read_lock();
(void)bpf_task_storage_get(&map_a, real_parent, 0, 0);
bpf_rcu_read_unlock(); return 0;
}
__noinline staticint static_subprog(void *ctx)
{ volatileint ret = 0;
if (bpf_get_prandom_u32()) return ret + 42; return ret + bpf_get_prandom_u32();
}
__noinline int global_subprog(u64 a)
{ volatileint ret = a;
return ret + static_subprog(NULL);
}
__noinline staticint static_subprog_lock(void *ctx)
{ volatileint ret = 0;
bpf_rcu_read_lock(); if (bpf_get_prandom_u32()) return ret + 42; return ret + bpf_get_prandom_u32();
}
__noinline int global_subprog_lock(u64 a)
{ volatileint ret = a;
return ret + static_subprog_lock(NULL);
}
__noinline staticint static_subprog_unlock(void *ctx)
{ volatileint ret = 0;
bpf_rcu_read_unlock(); if (bpf_get_prandom_u32()) return ret + 42; return ret + bpf_get_prandom_u32();
}
__noinline int global_subprog_unlock(u64 a)
{ volatileint ret = a;
return ret + static_subprog_unlock(NULL);
}
SEC("?fentry.s/" SYS_PREFIX "sys_getpgid") int rcu_read_lock_subprog(void *ctx)
{ volatileint ret = 0;
bpf_rcu_read_lock(); if (bpf_get_prandom_u32())
ret += static_subprog(ctx);
bpf_rcu_read_unlock(); return 0;
}
SEC("?fentry.s/" SYS_PREFIX "sys_getpgid") int rcu_read_lock_global_subprog(void *ctx)
{ volatileint ret = 0;
bpf_rcu_read_lock(); if (bpf_get_prandom_u32())
ret += global_subprog(ret);
bpf_rcu_read_unlock(); return 0;
}
SEC("?fentry.s/" SYS_PREFIX "sys_getpgid") int rcu_read_lock_subprog_lock(void *ctx)
{ volatileint ret = 0;
ret += static_subprog_lock(ctx);
bpf_rcu_read_unlock(); return 0;
}
SEC("?fentry.s/" SYS_PREFIX "sys_getpgid") int rcu_read_lock_global_subprog_lock(void *ctx)
{ volatileint ret = 0;
ret += global_subprog_lock(ret);
bpf_rcu_read_unlock(); return 0;
}
SEC("?fentry.s/" SYS_PREFIX "sys_getpgid") int rcu_read_lock_subprog_unlock(void *ctx)
{ volatileint ret = 0;
bpf_rcu_read_lock();
ret += static_subprog_unlock(ctx); return 0;
}
SEC("?fentry.s/" SYS_PREFIX "sys_getpgid") int rcu_read_lock_global_subprog_unlock(void *ctx)
{ volatileint ret = 0;
bpf_rcu_read_lock();
ret += global_subprog_unlock(ret); return 0;
}
int __noinline
global_sleepable_helper_subprog(int i)
{ if (i)
bpf_copy_from_user(&i, sizeof(i), NULL); return i;
}
int __noinline
global_sleepable_kfunc_subprog(int i)
{ if (i)
bpf_copy_from_user_str(&i, sizeof(i), NULL, 0);
global_subprog(i); return i;
}
int __noinline
global_subprog_calling_sleepable_global(int i)
{ if (!i)
global_sleepable_kfunc_subprog(i); return i;
}
SEC("?fentry.s/" SYS_PREFIX "sys_getpgid") int rcu_read_lock_sleepable_helper_global_subprog(void *ctx)
{ volatileint ret = 0;
bpf_rcu_read_lock();
ret += global_sleepable_helper_subprog(ret);
bpf_rcu_read_unlock(); return 0;
}
SEC("?fentry.s/" SYS_PREFIX "sys_getpgid") int rcu_read_lock_sleepable_kfunc_global_subprog(void *ctx)
{ volatileint ret = 0;
bpf_rcu_read_lock();
ret += global_sleepable_kfunc_subprog(ret);
bpf_rcu_read_unlock(); return 0;
}
SEC("?fentry.s/" SYS_PREFIX "sys_getpgid") int rcu_read_lock_sleepable_global_subprog_indirect(void *ctx)
{ volatileint ret = 0;
bpf_rcu_read_lock();
ret += global_subprog_calling_sleepable_global(ret);
bpf_rcu_read_unlock(); return 0;
}
Messung V0.5
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.12Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.