drm/nouveau: consume the return of large GSP message
[drm/drm-misc.git] / tools / perf / tests / workloads / brstack.c
blob0b60bd37b9d1af9eb7ede9ab740c2356581e444d
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #include <stdlib.h>
3 #include "../tests.h"
5 #define BENCH_RUNS 999999
7 static volatile int cnt;
9 static void brstack_bar(void) {
10 } /* return */
12 static void brstack_foo(void) {
13 brstack_bar(); /* call */
14 } /* return */
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;
29 if (argc > 0)
30 num_loops = atoi(argv[0]);
32 while (1) {
33 if ((cnt++) > num_loops)
34 break;
35 brstack_bench();/* call */
36 } /* branch (uncond) */
37 return 0;
40 DEFINE_WORKLOAD(brstack);