xref: /linux/tools/perf/trace/beauty/statx.c (revision c532de5a67a70f8533d495f8f2aaa9a0491c3ad0)
1 // SPDX-License-Identifier: LGPL-2.1
2 /*
3  * trace/beauty/statx.c
4  *
5  *  Copyright (C) 2017, Red Hat Inc, Arnaldo Carvalho de Melo <acme@redhat.com>
6  */
7 
8 #include "trace/beauty/beauty.h"
9 #include <sys/types.h>
10 #include <linux/log2.h>
11 
12 static size_t statx__scnprintf_mask(unsigned long mask, char *bf, size_t size, bool show_prefix)
13 {
14 	#include "trace/beauty/generated/statx_mask_array.c"
15 	static DEFINE_STRARRAY(statx_mask, "STATX_");
16 	return strarray__scnprintf_flags(&strarray__statx_mask, bf, size, show_prefix, mask);
17 }
18 
19 size_t syscall_arg__scnprintf_statx_mask(char *bf, size_t size, struct syscall_arg *arg)
20 {
21 	bool show_prefix = arg->show_string_prefix;
22 	int mask = arg->val;
23 
24 	return statx__scnprintf_mask(mask, bf, size, show_prefix);
25 }
26