sdt.c (cbecf716ca618fd44feda6bd9a64a8179d031fc5) sdt.c (d68f0365087395fe232e39ac9c8ee53627522c3c)
1// SPDX-License-Identifier: GPL-2.0
2#include <errno.h>
3#include <limits.h>
4#include <stdio.h>
5#include <stdlib.h>
6#include <unistd.h>
7#include <sys/epoll.h>
8#include <util/symbol.h>

--- 62 unchanged lines hidden (view full) ---

71 pr_debug("Failed to find %s:%s in the cache\n", group, event);
72 ret = -ENOENT;
73 }
74 probe_cache__delete(cache);
75
76 return ret;
77}
78
1// SPDX-License-Identifier: GPL-2.0
2#include <errno.h>
3#include <limits.h>
4#include <stdio.h>
5#include <stdlib.h>
6#include <unistd.h>
7#include <sys/epoll.h>
8#include <util/symbol.h>

--- 62 unchanged lines hidden (view full) ---

71 pr_debug("Failed to find %s:%s in the cache\n", group, event);
72 ret = -ENOENT;
73 }
74 probe_cache__delete(cache);
75
76 return ret;
77}
78
79int test__sdt_event(struct test *test __maybe_unused, int subtests __maybe_unused)
79static int test__sdt_event(struct test *test __maybe_unused, int subtests __maybe_unused)
80{
81 int ret = TEST_FAIL;
82 char __tempdir[] = "./test-buildid-XXXXXX";
83 char *tempdir = NULL, *myself = get_self_path();
84
85 if (myself == NULL || mkdtemp(__tempdir) == NULL) {
86 pr_debug("Failed to make a tempdir for build-id cache\n");
87 goto error;

--- 21 unchanged lines hidden (view full) ---

109 /* Cleanup temporary buildid dir */
110 rm_rf(__tempdir);
111error:
112 free(tempdir);
113 free(myself);
114 return ret;
115}
116#else
80{
81 int ret = TEST_FAIL;
82 char __tempdir[] = "./test-buildid-XXXXXX";
83 char *tempdir = NULL, *myself = get_self_path();
84
85 if (myself == NULL || mkdtemp(__tempdir) == NULL) {
86 pr_debug("Failed to make a tempdir for build-id cache\n");
87 goto error;

--- 21 unchanged lines hidden (view full) ---

109 /* Cleanup temporary buildid dir */
110 rm_rf(__tempdir);
111error:
112 free(tempdir);
113 free(myself);
114 return ret;
115}
116#else
117int test__sdt_event(struct test *test __maybe_unused, int subtests __maybe_unused)
117static int test__sdt_event(struct test *test __maybe_unused, int subtests __maybe_unused)
118{
119 pr_debug("Skip SDT event test because SDT support is not compiled\n");
120 return TEST_SKIP;
121}
122#endif
118{
119 pr_debug("Skip SDT event test because SDT support is not compiled\n");
120 return TEST_SKIP;
121}
122#endif
123
124DEFINE_SUITE("Probe SDT events", sdt_event);