1 /* SPDX-License-Identifier: GPL-2.0 */
5 #define BENCH_RUNS 999999
7 static volatile int cnt
;
9 static void brstack_bar(void) {
12 static void brstack_foo(void) {
13 brstack_bar(); /* call */
16 static void brstack_bench(void) {
17 void (*brstack_foo_ind
)(void) = brstack_foo
;
19 if ((cnt
++) % 3) /* branch (cond) */
20 brstack_foo(); /* call */
21 brstack_bar(); /* call */
22 brstack_foo_ind(); /* call (ind) */
25 static int brstack(int argc
, const char **argv
)
27 int num_loops
= BENCH_RUNS
;
30 num_loops
= atoi(argv
[0]);
33 if ((cnt
++) > num_loops
)
35 brstack_bench();/* call */
36 } /* branch (uncond) */
40 DEFINE_WORKLOAD(brstack
);