File: rpma_log_set_function.c

package info (click to toggle)
rpma 1.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 3,040 kB
  • sloc: ansic: 27,313; sh: 1,805; perl: 1,148; makefile: 8
file content (45 lines) | stat: -rw-r--r-- 727 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// SPDX-License-Identifier: BSD-3-Clause
/* Copyright 2022, Intel Corporation */

/*
 * rpma_log_set_function.c -- rpma_log_set_function multithreaded test
 */

#include <librpma.h>

#include "mtt.h"

/*
 * thread -- set log function
 */
void
thread(unsigned id, void *prestate, void *state, struct mtt_result *tr)
{
	int ret = rpma_log_set_function(RPMA_LOG_USE_DEFAULT_FUNCTION);
	if (ret) {
		MTT_RPMA_ERR(tr, "rpma_log_set_function", ret);
		return;
	}
}

int
main(int argc, char *argv[])
{
	struct mtt_args args = {0};

	if (mtt_parse_args(argc, argv, &args))
		return -1;

	struct mtt_test test = {
			NULL,
			NULL,
			NULL,
			NULL,
			thread,
			NULL,
			NULL,
			NULL
	};

	return mtt_run(&test, args.threads_num);
}