test-threadmap.c 565 字节
Newer Older
J
Jiri Olsa 已提交
1
// SPDX-License-Identifier: GPL-2.0
2 3
#include <stdarg.h>
#include <stdio.h>
J
Jiri Olsa 已提交
4 5 6
#include <perf/threadmap.h>
#include <internal/tests.h>

7 8 9 10 11 12
static int libperf_print(enum libperf_print_level level,
			 const char *fmt, va_list ap)
{
	return vfprintf(stderr, fmt, ap);
}

J
Jiri Olsa 已提交
13 14 15 16 17 18
int main(int argc, char **argv)
{
	struct perf_thread_map *threads;

	__T_START;

19 20
	libperf_init(libperf_print);

J
Jiri Olsa 已提交
21 22 23 24 25 26 27 28
	threads = perf_thread_map__new_dummy();
	if (!threads)
		return -1;

	perf_thread_map__get(threads);
	perf_thread_map__put(threads);
	perf_thread_map__put(threads);

J
Jiri Olsa 已提交
29
	__T_END;
J
Jiri Olsa 已提交
30 31
	return 0;
}