Browse Source

ioprio: add print_ioprio function

That respects xlat style settings.

* ioprio.c (print_ioprio): New function.
* defs.h (print_ioprio): New declaration.
Eugene Syromyatnikov 1 year ago
parent
commit
5801540ea9
2 changed files with 16 additions and 0 deletions
  1. 1
    0
      defs.h
  2. 15
    0
      ioprio.c

+ 1
- 0
defs.h View File

@@ -828,6 +828,7 @@ extern void print_numeric_long_umask(unsigned long);
828 828
 extern void print_dev_t(unsigned long long dev);
829 829
 extern void print_kernel_version(unsigned long version);
830 830
 extern void print_abnormal_hi(kernel_ulong_t);
831
+extern void print_ioprio(unsigned int ioprio);
831 832
 
832 833
 extern bool print_int32_array_member(struct tcb *, void *elem_buf,
833 834
 				     size_t elem_size, void *data);

+ 15
- 0
ioprio.c View File

@@ -34,6 +34,21 @@ sprint_ioprio(unsigned int ioprio)
34 34
 	return outstr;
35 35
 }
36 36
 
37
+void
38
+print_ioprio(unsigned int ioprio)
39
+{
40
+	if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV)
41
+		tprintf("%#x", ioprio);
42
+
43
+	if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW)
44
+		return;
45
+
46
+	const char *str = sprint_ioprio(ioprio);
47
+
48
+	(xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE
49
+		? tprints_comment : tprints)(str);
50
+}
51
+
37 52
 SYS_FUNC(ioprio_get)
38 53
 {
39 54
 	if (entering(tcp)) {

Loading…
Cancel
Save