cregit-Linux how code gets into the kernel

Release 4.14 tools/perf/tests/unit_number__scnprintf.c

Directory: tools/perf/tests
// SPDX-License-Identifier: GPL-2.0
#include <inttypes.h>
#include <linux/compiler.h>
#include <linux/types.h>
#include "tests.h"
#include "units.h"
#include "debug.h"


int test__unit_number__scnprint(struct test *t __maybe_unused, int subtest __maybe_unused) { struct { u64 n; const char *str; } test[] = { { 1, "1B" }, { 10*1024, "10K" }, { 20*1024*1024, "20M" }, { 30*1024*1024*1024ULL, "30G" }, { 0, "0B" }, { 0, NULL }, }; unsigned i = 0; while (test[i].str) { char buf[100]; unit_number__scnprintf(buf, sizeof(buf), test[i].n); pr_debug("n %" PRIu64 ", str '%s', buf '%s'\n", test[i].n, test[i].str, buf); if (strcmp(test[i].str, buf)) return TEST_FAIL; i++; } return TEST_OK; }

Contributors

PersonTokensPropCommitsCommitProp
Jiri Olsa15896.34%150.00%
Arnaldo Carvalho de Melo63.66%150.00%
Total164100.00%2100.00%


Overall Contributors

PersonTokensPropCommitsCommitProp
Jiri Olsa17293.99%120.00%
Arnaldo Carvalho de Melo105.46%360.00%
Greg Kroah-Hartman10.55%120.00%
Total183100.00%5100.00%
Directory: tools/perf/tests
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.