2019-07-21 13:25:01 +02:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2019-09-02 10:33:09 +02:00
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stdio.h>
|
2019-07-21 13:25:01 +02:00
|
|
|
#include <perf/threadmap.h>
|
|
|
|
#include <internal/tests.h>
|
2021-07-06 17:16:58 +02:00
|
|
|
#include "tests.h"
|
2019-07-21 13:25:01 +02:00
|
|
|
|
2019-09-02 10:33:09 +02:00
|
|
|
static int libperf_print(enum libperf_print_level level,
|
|
|
|
const char *fmt, va_list ap)
|
|
|
|
{
|
|
|
|
return vfprintf(stderr, fmt, ap);
|
|
|
|
}
|
|
|
|
|
2021-07-06 17:16:58 +02:00
|
|
|
int test_threadmap(int argc, char **argv)
|
2019-07-21 13:25:01 +02:00
|
|
|
{
|
|
|
|
struct perf_thread_map *threads;
|
|
|
|
|
|
|
|
__T_START;
|
|
|
|
|
2019-09-02 10:33:09 +02:00
|
|
|
libperf_init(libperf_print);
|
|
|
|
|
2019-07-21 13:25:01 +02:00
|
|
|
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);
|
|
|
|
|
2019-10-17 12:59:16 +02:00
|
|
|
__T_END;
|
2021-01-14 10:02:49 -08:00
|
|
|
return tests_failed == 0 ? 0 : -1;
|
2019-07-21 13:25:01 +02:00
|
|
|
}
|