hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/tools/perf/tests/sdt.c
....@@ -1,13 +1,17 @@
11 // SPDX-License-Identifier: GPL-2.0
22 #include <errno.h>
3
+#include <limits.h>
34 #include <stdio.h>
5
+#include <stdlib.h>
6
+#include <unistd.h>
47 #include <sys/epoll.h>
5
-#include <util/evlist.h>
8
+#include <util/symbol.h>
69 #include <linux/filter.h>
710 #include "tests.h"
811 #include "debug.h"
912 #include "probe-file.h"
1013 #include "build-id.h"
14
+#include "util.h"
1115
1216 /* To test SDT event, we need libelf support to scan elf binary */
1317 #if defined(HAVE_SDT_EVENT) && defined(HAVE_LIBELF_SUPPORT)
....@@ -24,16 +28,16 @@
2428 static int build_id_cache__add_file(const char *filename)
2529 {
2630 char sbuild_id[SBUILD_ID_SIZE];
27
- u8 build_id[BUILD_ID_SIZE];
31
+ struct build_id bid;
2832 int err;
2933
30
- err = filename__read_build_id(filename, &build_id, sizeof(build_id));
34
+ err = filename__read_build_id(filename, &bid);
3135 if (err < 0) {
3236 pr_debug("Failed to read build id of %s\n", filename);
3337 return err;
3438 }
3539
36
- build_id__sprintf(build_id, sizeof(build_id), sbuild_id);
40
+ build_id__sprintf(&bid, sbuild_id);
3741 err = build_id_cache__add_s(sbuild_id, filename, NULL, false, false);
3842 if (err < 0)
3943 pr_debug("Failed to add build id cache of %s\n", filename);