aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2018-07-24 14:02:40 -0400
committerAndreas Gruenbacher <agruenba@redhat.com>2018-07-24 14:02:40 -0400
commita3479c7fc096a1a7a2dccbfbdc6fcf86b805711a (patch)
tree85b0044b207d05b0cf5f118f2160a8de996073ce /tools
parent109dbb1e6f27fb8f80ee61953485c7c3b1717951 (diff)
parent025d0e7f73c6a9cc3ca2fe7de821792a8f3269bf (diff)
Merge branch 'iomap-write' into linux-gfs2/for-next
Pull in the gfs2 iomap-write changes: Tweak the existing code to properly support iomap write and eliminate an unnecessary special case in gfs2_block_map. Implement iomap write support for buffered and direct I/O. Simplify some of the existing code and eliminate code that is no longer used: gfs2: Remove gfs2_write_{begin,end} gfs2: iomap direct I/O support gfs2: gfs2_extent_length cleanup gfs2: iomap buffered write support gfs2: Further iomap cleanups This is based on the following changes on the xfs 'iomap-4.19-merge' branch: iomap: add private pointer to struct iomap iomap: add a page_done callback iomap: generic inline data handling iomap: complete partial direct I/O writes synchronously iomap: mark newly allocated buffer heads as new fs: factor out a __generic_write_end helper Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/include/uapi/linux/kvm.h4
-rw-r--r--tools/include/uapi/linux/prctl.h2
-rw-r--r--tools/lib/api/fs/fs.c2
-rw-r--r--tools/perf/util/bpf-prologue.c2
-rw-r--r--tools/power/cpupower/bench/parse.c2
-rw-r--r--tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c15
-rw-r--r--tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c35
-rw-r--r--tools/power/cpupower/utils/idle_monitor/cpupower-monitor.h9
-rw-r--r--tools/power/pm-graph/config/custom-timeline-functions.cfg4
-rw-r--r--tools/testing/selftests/bpf/Makefile4
-rw-r--r--tools/testing/selftests/cgroup/cgroup_util.c4
-rw-r--r--tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_string.tc8
-rw-r--r--tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_syntax.tc7
-rw-r--r--tools/testing/selftests/tc-testing/tc-tests/actions/ife.json2
14 files changed, 71 insertions, 29 deletions
diff --git a/tools/include/uapi/linux/kvm.h b/tools/include/uapi/linux/kvm.h
index b02c41e53d56..39e364c70caf 100644
--- a/tools/include/uapi/linux/kvm.h
+++ b/tools/include/uapi/linux/kvm.h
@@ -677,10 +677,10 @@ struct kvm_ioeventfd {
677}; 677};
678 678
679#define KVM_X86_DISABLE_EXITS_MWAIT (1 << 0) 679#define KVM_X86_DISABLE_EXITS_MWAIT (1 << 0)
680#define KVM_X86_DISABLE_EXITS_HTL (1 << 1) 680#define KVM_X86_DISABLE_EXITS_HLT (1 << 1)
681#define KVM_X86_DISABLE_EXITS_PAUSE (1 << 2) 681#define KVM_X86_DISABLE_EXITS_PAUSE (1 << 2)
682#define KVM_X86_DISABLE_VALID_EXITS (KVM_X86_DISABLE_EXITS_MWAIT | \ 682#define KVM_X86_DISABLE_VALID_EXITS (KVM_X86_DISABLE_EXITS_MWAIT | \
683 KVM_X86_DISABLE_EXITS_HTL | \ 683 KVM_X86_DISABLE_EXITS_HLT | \
684 KVM_X86_DISABLE_EXITS_PAUSE) 684 KVM_X86_DISABLE_EXITS_PAUSE)
685 685
686/* for KVM_ENABLE_CAP */ 686/* for KVM_ENABLE_CAP */
diff --git a/tools/include/uapi/linux/prctl.h b/tools/include/uapi/linux/prctl.h
index db9f15f5db04..c0d7ea0bf5b6 100644
--- a/tools/include/uapi/linux/prctl.h
+++ b/tools/include/uapi/linux/prctl.h
@@ -170,7 +170,7 @@ struct prctl_mm_map {
170 * asking selinux for a specific new context (e.g. with runcon) will result 170 * asking selinux for a specific new context (e.g. with runcon) will result
171 * in execve returning -EPERM. 171 * in execve returning -EPERM.
172 * 172 *
173 * See Documentation/prctl/no_new_privs.txt for more details. 173 * See Documentation/userspace-api/no_new_privs.rst for more details.
174 */ 174 */
175#define PR_SET_NO_NEW_PRIVS 38 175#define PR_SET_NO_NEW_PRIVS 38
176#define PR_GET_NO_NEW_PRIVS 39 176#define PR_GET_NO_NEW_PRIVS 39
diff --git a/tools/lib/api/fs/fs.c b/tools/lib/api/fs/fs.c
index 6a12bbf39f7b..7aba8243a0e7 100644
--- a/tools/lib/api/fs/fs.c
+++ b/tools/lib/api/fs/fs.c
@@ -201,7 +201,7 @@ static void mem_toupper(char *f, size_t len)
201 201
202/* 202/*
203 * Check for "NAME_PATH" environment variable to override fs location (for 203 * Check for "NAME_PATH" environment variable to override fs location (for
204 * testing). This matches the recommendation in Documentation/sysfs-rules.txt 204 * testing). This matches the recommendation in Documentation/admin-guide/sysfs-rules.rst
205 * for SYSFS_PATH. 205 * for SYSFS_PATH.
206 */ 206 */
207static bool fs__env_override(struct fs *fs) 207static bool fs__env_override(struct fs *fs)
diff --git a/tools/perf/util/bpf-prologue.c b/tools/perf/util/bpf-prologue.c
index 29347756b0af..77e4891e17b0 100644
--- a/tools/perf/util/bpf-prologue.c
+++ b/tools/perf/util/bpf-prologue.c
@@ -61,7 +61,7 @@ check_pos(struct bpf_insn_pos *pos)
61 61
62/* 62/*
63 * Convert type string (u8/u16/u32/u64/s8/s16/s32/s64 ..., see 63 * Convert type string (u8/u16/u32/u64/s8/s16/s32/s64 ..., see
64 * Documentation/trace/kprobetrace.txt) to size field of BPF_LDX_MEM 64 * Documentation/trace/kprobetrace.rst) to size field of BPF_LDX_MEM
65 * instruction (BPF_{B,H,W,DW}). 65 * instruction (BPF_{B,H,W,DW}).
66 */ 66 */
67static int 67static int
diff --git a/tools/power/cpupower/bench/parse.c b/tools/power/cpupower/bench/parse.c
index 9b65f052081f..9ba8a44ad2a7 100644
--- a/tools/power/cpupower/bench/parse.c
+++ b/tools/power/cpupower/bench/parse.c
@@ -104,7 +104,7 @@ FILE *prepare_output(const char *dirname)
104 dirname, time(NULL)); 104 dirname, time(NULL));
105 } 105 }
106 106
107 dprintf("logilename: %s\n", filename); 107 dprintf("logfilename: %s\n", filename);
108 108
109 output = fopen(filename, "w+"); 109 output = fopen(filename, "w+");
110 if (output == NULL) { 110 if (output == NULL) {
diff --git a/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c b/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c
index 5b3205f16217..5b8c4956ff9a 100644
--- a/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c
+++ b/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c
@@ -126,6 +126,20 @@ void fix_up_intel_idle_driver_name(char *tmp, int num)
126 } 126 }
127} 127}
128 128
129#ifdef __powerpc__
130void map_power_idle_state_name(char *tmp)
131{
132 if (!strncmp(tmp, "stop0_lite", CSTATE_NAME_LEN))
133 strcpy(tmp, "stop0L");
134 else if (!strncmp(tmp, "stop1_lite", CSTATE_NAME_LEN))
135 strcpy(tmp, "stop1L");
136 else if (!strncmp(tmp, "stop2_lite", CSTATE_NAME_LEN))
137 strcpy(tmp, "stop2L");
138}
139#else
140void map_power_idle_state_name(char *tmp) { }
141#endif
142
129static struct cpuidle_monitor *cpuidle_register(void) 143static struct cpuidle_monitor *cpuidle_register(void)
130{ 144{
131 int num; 145 int num;
@@ -145,6 +159,7 @@ static struct cpuidle_monitor *cpuidle_register(void)
145 if (tmp == NULL) 159 if (tmp == NULL)
146 continue; 160 continue;
147 161
162 map_power_idle_state_name(tmp);
148 fix_up_intel_idle_driver_name(tmp, num); 163 fix_up_intel_idle_driver_name(tmp, num);
149 strncpy(cpuidle_cstates[num].name, tmp, CSTATE_NAME_LEN - 1); 164 strncpy(cpuidle_cstates[num].name, tmp, CSTATE_NAME_LEN - 1);
150 free(tmp); 165 free(tmp);
diff --git a/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c b/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c
index 05f953f0f0a0..051da0a7c454 100644
--- a/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c
+++ b/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c
@@ -70,36 +70,43 @@ void print_n_spaces(int n)
70 printf(" "); 70 printf(" ");
71} 71}
72 72
73/* size of s must be at least n + 1 */ 73/*s is filled with left and right spaces
74 *to make its length atleast n+1
75 */
74int fill_string_with_spaces(char *s, int n) 76int fill_string_with_spaces(char *s, int n)
75{ 77{
78 char *temp;
76 int len = strlen(s); 79 int len = strlen(s);
77 if (len > n) 80
81 if (len >= n)
78 return -1; 82 return -1;
83
84 temp = malloc(sizeof(char) * (n+1));
79 for (; len < n; len++) 85 for (; len < n; len++)
80 s[len] = ' '; 86 s[len] = ' ';
81 s[len] = '\0'; 87 s[len] = '\0';
88 snprintf(temp, n+1, " %s", s);
89 strcpy(s, temp);
90 free(temp);
82 return 0; 91 return 0;
83} 92}
84 93
94#define MAX_COL_WIDTH 6
85void print_header(int topology_depth) 95void print_header(int topology_depth)
86{ 96{
87 int unsigned mon; 97 int unsigned mon;
88 int state, need_len; 98 int state, need_len;
89 cstate_t s; 99 cstate_t s;
90 char buf[128] = ""; 100 char buf[128] = "";
91 int percent_width = 4;
92 101
93 fill_string_with_spaces(buf, topology_depth * 5 - 1); 102 fill_string_with_spaces(buf, topology_depth * 5 - 1);
94 printf("%s|", buf); 103 printf("%s|", buf);
95 104
96 for (mon = 0; mon < avail_monitors; mon++) { 105 for (mon = 0; mon < avail_monitors; mon++) {
97 need_len = monitors[mon]->hw_states_num * (percent_width + 3) 106 need_len = monitors[mon]->hw_states_num * (MAX_COL_WIDTH + 1)
98 - 1; 107 - 1;
99 if (mon != 0) { 108 if (mon != 0)
100 printf("|| "); 109 printf("||");
101 need_len--;
102 }
103 sprintf(buf, "%s", monitors[mon]->name); 110 sprintf(buf, "%s", monitors[mon]->name);
104 fill_string_with_spaces(buf, need_len); 111 fill_string_with_spaces(buf, need_len);
105 printf("%s", buf); 112 printf("%s", buf);
@@ -107,23 +114,21 @@ void print_header(int topology_depth)
107 printf("\n"); 114 printf("\n");
108 115
109 if (topology_depth > 2) 116 if (topology_depth > 2)
110 printf("PKG |"); 117 printf(" PKG|");
111 if (topology_depth > 1) 118 if (topology_depth > 1)
112 printf("CORE|"); 119 printf("CORE|");
113 if (topology_depth > 0) 120 if (topology_depth > 0)
114 printf("CPU |"); 121 printf(" CPU|");
115 122
116 for (mon = 0; mon < avail_monitors; mon++) { 123 for (mon = 0; mon < avail_monitors; mon++) {
117 if (mon != 0) 124 if (mon != 0)
118 printf("|| "); 125 printf("||");
119 else
120 printf(" ");
121 for (state = 0; state < monitors[mon]->hw_states_num; state++) { 126 for (state = 0; state < monitors[mon]->hw_states_num; state++) {
122 if (state != 0) 127 if (state != 0)
123 printf(" | "); 128 printf("|");
124 s = monitors[mon]->hw_states[state]; 129 s = monitors[mon]->hw_states[state];
125 sprintf(buf, "%s", s.name); 130 sprintf(buf, "%s", s.name);
126 fill_string_with_spaces(buf, percent_width); 131 fill_string_with_spaces(buf, MAX_COL_WIDTH);
127 printf("%s", buf); 132 printf("%s", buf);
128 } 133 }
129 printf(" "); 134 printf(" ");
diff --git a/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.h b/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.h
index 9e43f3371fbc..2ae50b499e0a 100644
--- a/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.h
+++ b/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.h
@@ -15,7 +15,16 @@
15 15
16#define MONITORS_MAX 20 16#define MONITORS_MAX 20
17#define MONITOR_NAME_LEN 20 17#define MONITOR_NAME_LEN 20
18
19/* CSTATE_NAME_LEN is limited by header field width defined
20 * in cpupower-monitor.c. Header field width is defined to be
21 * sum of percent width and two spaces for padding.
22 */
23#ifdef __powerpc__
24#define CSTATE_NAME_LEN 7
25#else
18#define CSTATE_NAME_LEN 5 26#define CSTATE_NAME_LEN 5
27#endif
19#define CSTATE_DESC_LEN 60 28#define CSTATE_DESC_LEN 60
20 29
21int cpu_count; 30int cpu_count;
diff --git a/tools/power/pm-graph/config/custom-timeline-functions.cfg b/tools/power/pm-graph/config/custom-timeline-functions.cfg
index 4f80ad7d7275..f8fcb06fd68b 100644
--- a/tools/power/pm-graph/config/custom-timeline-functions.cfg
+++ b/tools/power/pm-graph/config/custom-timeline-functions.cfg
@@ -105,7 +105,7 @@ override-dev-timeline-functions: true
105# example: [color=#CC00CC] 105# example: [color=#CC00CC]
106# 106#
107# arglist: A list of arguments from registers/stack addresses. See URL: 107# arglist: A list of arguments from registers/stack addresses. See URL:
108# https://www.kernel.org/doc/Documentation/trace/kprobetrace.txt 108# https://www.kernel.org/doc/Documentation/trace/kprobetrace.rst
109# 109#
110# example: cpu=%di:s32 110# example: cpu=%di:s32
111# 111#
@@ -170,7 +170,7 @@ pm_restore_console:
170# example: [color=#CC00CC] 170# example: [color=#CC00CC]
171# 171#
172# arglist: A list of arguments from registers/stack addresses. See URL: 172# arglist: A list of arguments from registers/stack addresses. See URL:
173# https://www.kernel.org/doc/Documentation/trace/kprobetrace.txt 173# https://www.kernel.org/doc/Documentation/trace/kprobetrace.rst
174# 174#
175# example: port=+36(%di):s32 175# example: port=+36(%di):s32
176# 176#
diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
index 607ed8729c06..7a6214e9ae58 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -16,9 +16,7 @@ LDLIBS += -lcap -lelf -lrt -lpthread
16TEST_CUSTOM_PROGS = $(OUTPUT)/urandom_read 16TEST_CUSTOM_PROGS = $(OUTPUT)/urandom_read
17all: $(TEST_CUSTOM_PROGS) 17all: $(TEST_CUSTOM_PROGS)
18 18
19$(TEST_CUSTOM_PROGS): urandom_read 19$(TEST_CUSTOM_PROGS): $(OUTPUT)/%: %.c
20
21urandom_read: urandom_read.c
22 $(CC) -o $(TEST_CUSTOM_PROGS) -static $< -Wl,--build-id 20 $(CC) -o $(TEST_CUSTOM_PROGS) -static $< -Wl,--build-id
23 21
24# Order correspond to 'make run_tests' order 22# Order correspond to 'make run_tests' order
diff --git a/tools/testing/selftests/cgroup/cgroup_util.c b/tools/testing/selftests/cgroup/cgroup_util.c
index b69bdeb4b9fe..1e9e3c470561 100644
--- a/tools/testing/selftests/cgroup/cgroup_util.c
+++ b/tools/testing/selftests/cgroup/cgroup_util.c
@@ -35,7 +35,7 @@ out:
35 return len; 35 return len;
36} 36}
37 37
38static ssize_t write_text(const char *path, char *buf, size_t len) 38static ssize_t write_text(const char *path, char *buf, ssize_t len)
39{ 39{
40 int fd; 40 int fd;
41 41
@@ -140,7 +140,7 @@ long cg_read_key_long(const char *cgroup, const char *control, const char *key)
140int cg_write(const char *cgroup, const char *control, char *buf) 140int cg_write(const char *cgroup, const char *control, char *buf)
141{ 141{
142 char path[PATH_MAX]; 142 char path[PATH_MAX];
143 size_t len = strlen(buf); 143 ssize_t len = strlen(buf);
144 144
145 snprintf(path, sizeof(path), "%s/%s", cgroup, control); 145 snprintf(path, sizeof(path), "%s/%s", cgroup, control);
146 146
diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_string.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_string.tc
index 5ba73035e1d9..a0002563e9ee 100644
--- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_string.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_string.tc
@@ -24,6 +24,14 @@ arm*)
24 ARG2=%r1 24 ARG2=%r1
25 OFFS=4 25 OFFS=4
26;; 26;;
27ppc64*)
28 ARG2=%r4
29 OFFS=8
30;;
31ppc*)
32 ARG2=%r4
33 OFFS=4
34;;
27*) 35*)
28 echo "Please implement other architecture here" 36 echo "Please implement other architecture here"
29 exit_untested 37 exit_untested
diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_syntax.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_syntax.tc
index 231bcd2c4eb5..d026ff4e562f 100644
--- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_syntax.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_syntax.tc
@@ -34,6 +34,13 @@ arm*)
34 GOODREG=%r0 34 GOODREG=%r0
35 BADREG=%ax 35 BADREG=%ax
36;; 36;;
37ppc*)
38 GOODREG=%r3
39 BADREG=%msr
40;;
41*)
42 echo "Please implement other architecture here"
43 exit_untested
37esac 44esac
38 45
39test_goodarg() # Good-args 46test_goodarg() # Good-args
diff --git a/tools/testing/selftests/tc-testing/tc-tests/actions/ife.json b/tools/testing/selftests/tc-testing/tc-tests/actions/ife.json
index de97e4ff705c..637ea0219617 100644
--- a/tools/testing/selftests/tc-testing/tc-tests/actions/ife.json
+++ b/tools/testing/selftests/tc-testing/tc-tests/actions/ife.json
@@ -568,7 +568,7 @@
568 "matchPattern": "action order [0-9]*: ife encode action pass.*type 0xED3E.*use tcindex 65535.*index 1", 568 "matchPattern": "action order [0-9]*: ife encode action pass.*type 0xED3E.*use tcindex 65535.*index 1",
569 "matchCount": "1", 569 "matchCount": "1",
570 "teardown": [ 570 "teardown": [
571 "$TC actions flush action skbedit" 571 "$TC actions flush action ife"
572 ] 572 ]
573 }, 573 },
574 { 574 {