diff options
author | David S. Miller <davem@davemloft.net> | 2016-02-23 00:09:14 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-02-23 00:09:14 -0500 |
commit | b633353115e352d3c31c12d4c61978c810f05ea1 (patch) | |
tree | 055174a1b31a3e10fd2c505788fe6487b0028d00 /tools | |
parent | b1d95ae5c5bd3deba84d00c4f83d7d0836b5936f (diff) | |
parent | dea08e604408d0303e2332896c5fdd8c1f7d79a2 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
drivers/net/phy/bcm7xxx.c
drivers/net/phy/marvell.c
drivers/net/vxlan.c
All three conflicts were cases of simple overlapping changes.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/intel-pt.c | 9 | ||||
-rw-r--r-- | tools/perf/util/parse-events.c | 3 | ||||
-rw-r--r-- | tools/perf/util/probe-finder.c | 62 | ||||
-rw-r--r-- | tools/perf/util/probe-finder.h | 5 | ||||
-rw-r--r-- | tools/perf/util/stat.c | 10 | ||||
-rwxr-xr-x | tools/testing/selftests/efivarfs/efivarfs.sh | 19 | ||||
-rw-r--r-- | tools/testing/selftests/efivarfs/open-unlink.c | 72 |
7 files changed, 150 insertions, 30 deletions
diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c index 81a2eb77ba7f..05d815851be1 100644 --- a/tools/perf/util/intel-pt.c +++ b/tools/perf/util/intel-pt.c | |||
@@ -2068,6 +2068,15 @@ int intel_pt_process_auxtrace_info(union perf_event *event, | |||
2068 | err = -ENOMEM; | 2068 | err = -ENOMEM; |
2069 | goto err_free_queues; | 2069 | goto err_free_queues; |
2070 | } | 2070 | } |
2071 | |||
2072 | /* | ||
2073 | * Since this thread will not be kept in any rbtree not in a | ||
2074 | * list, initialize its list node so that at thread__put() the | ||
2075 | * current thread lifetime assuption is kept and we don't segfault | ||
2076 | * at list_del_init(). | ||
2077 | */ | ||
2078 | INIT_LIST_HEAD(&pt->unknown_thread->node); | ||
2079 | |||
2071 | err = thread__set_comm(pt->unknown_thread, "unknown", 0); | 2080 | err = thread__set_comm(pt->unknown_thread, "unknown", 0); |
2072 | if (err) | 2081 | if (err) |
2073 | goto err_delete_thread; | 2082 | goto err_delete_thread; |
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 4f7b0efdde2f..813d9b272c81 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c | |||
@@ -399,6 +399,9 @@ static void tracepoint_error(struct parse_events_error *e, int err, | |||
399 | { | 399 | { |
400 | char help[BUFSIZ]; | 400 | char help[BUFSIZ]; |
401 | 401 | ||
402 | if (!e) | ||
403 | return; | ||
404 | |||
402 | /* | 405 | /* |
403 | * We get error directly from syscall errno ( > 0), | 406 | * We get error directly from syscall errno ( > 0), |
404 | * or from encoded pointer's error ( < 0). | 407 | * or from encoded pointer's error ( < 0). |
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c index 2be10fb27172..4ce5c5e18f48 100644 --- a/tools/perf/util/probe-finder.c +++ b/tools/perf/util/probe-finder.c | |||
@@ -686,8 +686,9 @@ static int call_probe_finder(Dwarf_Die *sc_die, struct probe_finder *pf) | |||
686 | pf->fb_ops = NULL; | 686 | pf->fb_ops = NULL; |
687 | #if _ELFUTILS_PREREQ(0, 142) | 687 | #if _ELFUTILS_PREREQ(0, 142) |
688 | } else if (nops == 1 && pf->fb_ops[0].atom == DW_OP_call_frame_cfa && | 688 | } else if (nops == 1 && pf->fb_ops[0].atom == DW_OP_call_frame_cfa && |
689 | pf->cfi != NULL) { | 689 | (pf->cfi_eh != NULL || pf->cfi_dbg != NULL)) { |
690 | if (dwarf_cfi_addrframe(pf->cfi, pf->addr, &frame) != 0 || | 690 | if ((dwarf_cfi_addrframe(pf->cfi_eh, pf->addr, &frame) != 0 && |
691 | (dwarf_cfi_addrframe(pf->cfi_dbg, pf->addr, &frame) != 0)) || | ||
691 | dwarf_frame_cfa(frame, &pf->fb_ops, &nops) != 0) { | 692 | dwarf_frame_cfa(frame, &pf->fb_ops, &nops) != 0) { |
692 | pr_warning("Failed to get call frame on 0x%jx\n", | 693 | pr_warning("Failed to get call frame on 0x%jx\n", |
693 | (uintmax_t)pf->addr); | 694 | (uintmax_t)pf->addr); |
@@ -1015,8 +1016,7 @@ static int pubname_search_cb(Dwarf *dbg, Dwarf_Global *gl, void *data) | |||
1015 | return DWARF_CB_OK; | 1016 | return DWARF_CB_OK; |
1016 | } | 1017 | } |
1017 | 1018 | ||
1018 | /* Find probe points from debuginfo */ | 1019 | static int debuginfo__find_probe_location(struct debuginfo *dbg, |
1019 | static int debuginfo__find_probes(struct debuginfo *dbg, | ||
1020 | struct probe_finder *pf) | 1020 | struct probe_finder *pf) |
1021 | { | 1021 | { |
1022 | struct perf_probe_point *pp = &pf->pev->point; | 1022 | struct perf_probe_point *pp = &pf->pev->point; |
@@ -1025,27 +1025,6 @@ static int debuginfo__find_probes(struct debuginfo *dbg, | |||
1025 | Dwarf_Die *diep; | 1025 | Dwarf_Die *diep; |
1026 | int ret = 0; | 1026 | int ret = 0; |
1027 | 1027 | ||
1028 | #if _ELFUTILS_PREREQ(0, 142) | ||
1029 | Elf *elf; | ||
1030 | GElf_Ehdr ehdr; | ||
1031 | GElf_Shdr shdr; | ||
1032 | |||
1033 | /* Get the call frame information from this dwarf */ | ||
1034 | elf = dwarf_getelf(dbg->dbg); | ||
1035 | if (elf == NULL) | ||
1036 | return -EINVAL; | ||
1037 | |||
1038 | if (gelf_getehdr(elf, &ehdr) == NULL) | ||
1039 | return -EINVAL; | ||
1040 | |||
1041 | if (elf_section_by_name(elf, &ehdr, &shdr, ".eh_frame", NULL) && | ||
1042 | shdr.sh_type == SHT_PROGBITS) { | ||
1043 | pf->cfi = dwarf_getcfi_elf(elf); | ||
1044 | } else { | ||
1045 | pf->cfi = dwarf_getcfi(dbg->dbg); | ||
1046 | } | ||
1047 | #endif | ||
1048 | |||
1049 | off = 0; | 1028 | off = 0; |
1050 | pf->lcache = intlist__new(NULL); | 1029 | pf->lcache = intlist__new(NULL); |
1051 | if (!pf->lcache) | 1030 | if (!pf->lcache) |
@@ -1108,6 +1087,39 @@ found: | |||
1108 | return ret; | 1087 | return ret; |
1109 | } | 1088 | } |
1110 | 1089 | ||
1090 | /* Find probe points from debuginfo */ | ||
1091 | static int debuginfo__find_probes(struct debuginfo *dbg, | ||
1092 | struct probe_finder *pf) | ||
1093 | { | ||
1094 | int ret = 0; | ||
1095 | |||
1096 | #if _ELFUTILS_PREREQ(0, 142) | ||
1097 | Elf *elf; | ||
1098 | GElf_Ehdr ehdr; | ||
1099 | GElf_Shdr shdr; | ||
1100 | |||
1101 | if (pf->cfi_eh || pf->cfi_dbg) | ||
1102 | return debuginfo__find_probe_location(dbg, pf); | ||
1103 | |||
1104 | /* Get the call frame information from this dwarf */ | ||
1105 | elf = dwarf_getelf(dbg->dbg); | ||
1106 | if (elf == NULL) | ||
1107 | return -EINVAL; | ||
1108 | |||
1109 | if (gelf_getehdr(elf, &ehdr) == NULL) | ||
1110 | return -EINVAL; | ||
1111 | |||
1112 | if (elf_section_by_name(elf, &ehdr, &shdr, ".eh_frame", NULL) && | ||
1113 | shdr.sh_type == SHT_PROGBITS) | ||
1114 | pf->cfi_eh = dwarf_getcfi_elf(elf); | ||
1115 | |||
1116 | pf->cfi_dbg = dwarf_getcfi(dbg->dbg); | ||
1117 | #endif | ||
1118 | |||
1119 | ret = debuginfo__find_probe_location(dbg, pf); | ||
1120 | return ret; | ||
1121 | } | ||
1122 | |||
1111 | struct local_vars_finder { | 1123 | struct local_vars_finder { |
1112 | struct probe_finder *pf; | 1124 | struct probe_finder *pf; |
1113 | struct perf_probe_arg *args; | 1125 | struct perf_probe_arg *args; |
diff --git a/tools/perf/util/probe-finder.h b/tools/perf/util/probe-finder.h index bed82716e1b4..0aec7704e395 100644 --- a/tools/perf/util/probe-finder.h +++ b/tools/perf/util/probe-finder.h | |||
@@ -76,7 +76,10 @@ struct probe_finder { | |||
76 | 76 | ||
77 | /* For variable searching */ | 77 | /* For variable searching */ |
78 | #if _ELFUTILS_PREREQ(0, 142) | 78 | #if _ELFUTILS_PREREQ(0, 142) |
79 | Dwarf_CFI *cfi; /* Call Frame Information */ | 79 | /* Call Frame Information from .eh_frame */ |
80 | Dwarf_CFI *cfi_eh; | ||
81 | /* Call Frame Information from .debug_frame */ | ||
82 | Dwarf_CFI *cfi_dbg; | ||
80 | #endif | 83 | #endif |
81 | Dwarf_Op *fb_ops; /* Frame base attribute */ | 84 | Dwarf_Op *fb_ops; /* Frame base attribute */ |
82 | struct perf_probe_arg *pvar; /* Current target variable */ | 85 | struct perf_probe_arg *pvar; /* Current target variable */ |
diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c index 2b58edccd56f..afb0c45eba34 100644 --- a/tools/perf/util/stat.c +++ b/tools/perf/util/stat.c | |||
@@ -311,6 +311,16 @@ int perf_stat_process_counter(struct perf_stat_config *config, | |||
311 | 311 | ||
312 | aggr->val = aggr->ena = aggr->run = 0; | 312 | aggr->val = aggr->ena = aggr->run = 0; |
313 | 313 | ||
314 | /* | ||
315 | * We calculate counter's data every interval, | ||
316 | * and the display code shows ps->res_stats | ||
317 | * avg value. We need to zero the stats for | ||
318 | * interval mode, otherwise overall avg running | ||
319 | * averages will be shown for each interval. | ||
320 | */ | ||
321 | if (config->interval) | ||
322 | init_stats(ps->res_stats); | ||
323 | |||
314 | if (counter->per_pkg) | 324 | if (counter->per_pkg) |
315 | zero_per_pkg(counter); | 325 | zero_per_pkg(counter); |
316 | 326 | ||
diff --git a/tools/testing/selftests/efivarfs/efivarfs.sh b/tools/testing/selftests/efivarfs/efivarfs.sh index 77edcdcc016b..057278448515 100755 --- a/tools/testing/selftests/efivarfs/efivarfs.sh +++ b/tools/testing/selftests/efivarfs/efivarfs.sh | |||
@@ -88,7 +88,11 @@ test_delete() | |||
88 | exit 1 | 88 | exit 1 |
89 | fi | 89 | fi |
90 | 90 | ||
91 | rm $file | 91 | rm $file 2>/dev/null |
92 | if [ $? -ne 0 ]; then | ||
93 | chattr -i $file | ||
94 | rm $file | ||
95 | fi | ||
92 | 96 | ||
93 | if [ -e $file ]; then | 97 | if [ -e $file ]; then |
94 | echo "$file couldn't be deleted" >&2 | 98 | echo "$file couldn't be deleted" >&2 |
@@ -111,6 +115,7 @@ test_zero_size_delete() | |||
111 | exit 1 | 115 | exit 1 |
112 | fi | 116 | fi |
113 | 117 | ||
118 | chattr -i $file | ||
114 | printf "$attrs" > $file | 119 | printf "$attrs" > $file |
115 | 120 | ||
116 | if [ -e $file ]; then | 121 | if [ -e $file ]; then |
@@ -141,7 +146,11 @@ test_valid_filenames() | |||
141 | echo "$file could not be created" >&2 | 146 | echo "$file could not be created" >&2 |
142 | ret=1 | 147 | ret=1 |
143 | else | 148 | else |
144 | rm $file | 149 | rm $file 2>/dev/null |
150 | if [ $? -ne 0 ]; then | ||
151 | chattr -i $file | ||
152 | rm $file | ||
153 | fi | ||
145 | fi | 154 | fi |
146 | done | 155 | done |
147 | 156 | ||
@@ -174,7 +183,11 @@ test_invalid_filenames() | |||
174 | 183 | ||
175 | if [ -e $file ]; then | 184 | if [ -e $file ]; then |
176 | echo "Creating $file should have failed" >&2 | 185 | echo "Creating $file should have failed" >&2 |
177 | rm $file | 186 | rm $file 2>/dev/null |
187 | if [ $? -ne 0 ]; then | ||
188 | chattr -i $file | ||
189 | rm $file | ||
190 | fi | ||
178 | ret=1 | 191 | ret=1 |
179 | fi | 192 | fi |
180 | done | 193 | done |
diff --git a/tools/testing/selftests/efivarfs/open-unlink.c b/tools/testing/selftests/efivarfs/open-unlink.c index 8c0764407b3c..4af74f733036 100644 --- a/tools/testing/selftests/efivarfs/open-unlink.c +++ b/tools/testing/selftests/efivarfs/open-unlink.c | |||
@@ -1,10 +1,68 @@ | |||
1 | #include <errno.h> | ||
1 | #include <stdio.h> | 2 | #include <stdio.h> |
2 | #include <stdint.h> | 3 | #include <stdint.h> |
3 | #include <stdlib.h> | 4 | #include <stdlib.h> |
4 | #include <unistd.h> | 5 | #include <unistd.h> |
6 | #include <sys/ioctl.h> | ||
5 | #include <sys/types.h> | 7 | #include <sys/types.h> |
6 | #include <sys/stat.h> | 8 | #include <sys/stat.h> |
7 | #include <fcntl.h> | 9 | #include <fcntl.h> |
10 | #include <linux/fs.h> | ||
11 | |||
12 | static int set_immutable(const char *path, int immutable) | ||
13 | { | ||
14 | unsigned int flags; | ||
15 | int fd; | ||
16 | int rc; | ||
17 | int error; | ||
18 | |||
19 | fd = open(path, O_RDONLY); | ||
20 | if (fd < 0) | ||
21 | return fd; | ||
22 | |||
23 | rc = ioctl(fd, FS_IOC_GETFLAGS, &flags); | ||
24 | if (rc < 0) { | ||
25 | error = errno; | ||
26 | close(fd); | ||
27 | errno = error; | ||
28 | return rc; | ||
29 | } | ||
30 | |||
31 | if (immutable) | ||
32 | flags |= FS_IMMUTABLE_FL; | ||
33 | else | ||
34 | flags &= ~FS_IMMUTABLE_FL; | ||
35 | |||
36 | rc = ioctl(fd, FS_IOC_SETFLAGS, &flags); | ||
37 | error = errno; | ||
38 | close(fd); | ||
39 | errno = error; | ||
40 | return rc; | ||
41 | } | ||
42 | |||
43 | static int get_immutable(const char *path) | ||
44 | { | ||
45 | unsigned int flags; | ||
46 | int fd; | ||
47 | int rc; | ||
48 | int error; | ||
49 | |||
50 | fd = open(path, O_RDONLY); | ||
51 | if (fd < 0) | ||
52 | return fd; | ||
53 | |||
54 | rc = ioctl(fd, FS_IOC_GETFLAGS, &flags); | ||
55 | if (rc < 0) { | ||
56 | error = errno; | ||
57 | close(fd); | ||
58 | errno = error; | ||
59 | return rc; | ||
60 | } | ||
61 | close(fd); | ||
62 | if (flags & FS_IMMUTABLE_FL) | ||
63 | return 1; | ||
64 | return 0; | ||
65 | } | ||
8 | 66 | ||
9 | int main(int argc, char **argv) | 67 | int main(int argc, char **argv) |
10 | { | 68 | { |
@@ -27,7 +85,7 @@ int main(int argc, char **argv) | |||
27 | buf[4] = 0; | 85 | buf[4] = 0; |
28 | 86 | ||
29 | /* create a test variable */ | 87 | /* create a test variable */ |
30 | fd = open(path, O_WRONLY | O_CREAT); | 88 | fd = open(path, O_WRONLY | O_CREAT, 0600); |
31 | if (fd < 0) { | 89 | if (fd < 0) { |
32 | perror("open(O_WRONLY)"); | 90 | perror("open(O_WRONLY)"); |
33 | return EXIT_FAILURE; | 91 | return EXIT_FAILURE; |
@@ -41,6 +99,18 @@ int main(int argc, char **argv) | |||
41 | 99 | ||
42 | close(fd); | 100 | close(fd); |
43 | 101 | ||
102 | rc = get_immutable(path); | ||
103 | if (rc < 0) { | ||
104 | perror("ioctl(FS_IOC_GETFLAGS)"); | ||
105 | return EXIT_FAILURE; | ||
106 | } else if (rc) { | ||
107 | rc = set_immutable(path, 0); | ||
108 | if (rc < 0) { | ||
109 | perror("ioctl(FS_IOC_SETFLAGS)"); | ||
110 | return EXIT_FAILURE; | ||
111 | } | ||
112 | } | ||
113 | |||
44 | fd = open(path, O_RDONLY); | 114 | fd = open(path, O_RDONLY); |
45 | if (fd < 0) { | 115 | if (fd < 0) { |
46 | perror("open"); | 116 | perror("open"); |