1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright (c) 2021 Facebook */
3 
4 #include <test_progs.h>
5 
6 #include "trace_vprintk.lskel.h"
7 
8 void test_verif_stats(void)
9 {
10 	__u32 len = sizeof(struct bpf_prog_info);
11 	struct trace_vprintk_lskel *skel;
12 	struct bpf_prog_info info = {};
13 	int err;
14 
15 	skel = trace_vprintk_lskel__open_and_load();
16 	if (!ASSERT_OK_PTR(skel, "trace_vprintk__open_and_load"))
17 		goto cleanup;
18 
19 	err = bpf_obj_get_info_by_fd(skel->progs.sys_enter.prog_fd, &info, &len);
20 	if (!ASSERT_OK(err, "bpf_obj_get_info_by_fd"))
21 		goto cleanup;
22 
23 	if (!ASSERT_GT(info.verified_insns, 0, "verified_insns"))
24 		goto cleanup;
25 
26 cleanup:
27 	trace_vprintk_lskel__destroy(skel);
28 }
29