X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=tests%2Funit%2Flibcommon%2Fget_max_cpuid_from_sysfs.c;fp=tests%2Funit%2Flibcommon%2Fget_max_cpuid_from_sysfs.c;h=cc856c6d9a4b3d2e87c0866242fb1a3f10de37ff;hb=fb0f6ca9385e1813311cfd917c130b40bec04970;hp=0000000000000000000000000000000000000000;hpb=a616fb4e0a0245ae2cbd4614910480df19aa23d6;p=lttng-ust.git diff --git a/tests/unit/libcommon/get_max_cpuid_from_sysfs.c b/tests/unit/libcommon/get_max_cpuid_from_sysfs.c new file mode 100644 index 00000000..cc856c6d --- /dev/null +++ b/tests/unit/libcommon/get_max_cpuid_from_sysfs.c @@ -0,0 +1,29 @@ +/* + * SPDX-License-Identifier: LGPL-2.1-only + * + * Copyright (C) 2022 Michael Jeanson + */ + +#include +#include + +#include "common/smp.h" + +int main(int argc, char *argv[]) +{ + int ret; + + if( argc < 2 ) { + fprintf(stderr, "Missing argument.\n"); + return EXIT_FAILURE; + } + + ret = _get_max_cpuid_from_sysfs(argv[1]); + + printf("%d\n", ret); + + if (ret >= 0) + return EXIT_SUCCESS; + else + return EXIT_FAILURE; +}