diff options
author | James Bottomley <JBottomley@Parallels.com> | 2012-05-21 07:17:30 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-05-21 07:17:30 -0400 |
commit | e34693336564f02b3e2cc09d8b872aef22a154e9 (patch) | |
tree | 09f51f10f9406042f9176e39b4dc8de850ba712e /tools | |
parent | 76b311fdbdd2e16e5d39cd496a67aa1a1b948914 (diff) | |
parent | de2eb4d5c5c25e8fb75d1e19092f24b83cb7d8d5 (diff) |
Merge tag 'isci-for-3.5' into misc
isci update for 3.5
1/ Rework remote-node-context (RNC) handling for proper management of
the silicon state machine in error handling and hot-plug conditions.
Further details below, suffice to say if the RNC is mismanaged the
silicon state machines may lock up.
2/ Refactor the initialization code to be reused for suspend/resume support
3/ Miscellaneous bug fixes to address discovery issues and hardware
compatibility.
RNC rework details from Jeff Skirvin:
In the controller, devices as they appear on a SAS domain (or
direct-attached SATA devices) are represented by memory structures known
as "Remote Node Contexts" (RNCs). These structures are transferred from
main memory to the controller using a set of register commands; these
commands include setting up the context ("posting"), removing the
context ("invalidating"), and commands to control the scheduling of
commands and connections to that remote device ("suspensions" and
"resumptions"). There is a similar path to control RNC scheduling from
the protocol engine, which interprets the results of command and data
transmission and reception.
In general, the controller chooses among non-suspended RNCs to find one
that has work requiring scheduling the transmission of command and data
frames to a target. Likewise, when a target tries to return data back
to the initiator, the state of the RNC is used by the controller to
determine how to treat the incoming request. As an example, if the RNC
is in the state "TX/RX Suspended", incoming SSP connection requests from
the target will be rejected by the controller hardware. When an RNC is
"TX Suspended", it will not be selected by the controller hardware to
start outgoing command or data operations (with certain priority-based
exceptions).
As mentioned above, there are two sources for management of the RNC
states: commands from driver software, and the result of transmission
and reception conditions of commands and data signaled by the controller
hardware. As an example of the latter, if an outgoing SSP command ends
with a OPEN_REJECT(BAD_DESTINATION) status, the RNC state will
transition to the "TX Suspended" state, and this is signaled by the
controller hardware in the status to the completion of the pending
command as well as signaled in a controller hardware event. Examples of
the former are included in the patch changelogs.
Driver software is required to suspend the RNC in a "TX/RX Suspended"
condition before any outstanding commands can be terminated. Failure to
guarantee this can lead to a complete hardware hang condition. Earlier
versions of the driver software did not guarantee that an RNC was
correctly managed before I/O termination, and so operated in an unsafe
way.
Further, the driver performed unnecessary contortions to preserve the
remote device command state and so was more complicated than it needed
to be. A simplifying driver assumption is that once an I/O has entered
the error handler path without having completed in the target, the
requirement on the driver is that all use of the sas_task must end.
Beyond that, recovery of operation is dependent on libsas and other
components to reset, rediscover and reconfigure the device before normal
operation can restart. In the driver, this simplifying assumption meant
that the RNC management could be reduced to entry into the suspended
state, terminating the targeted I/O request, and resuming the RNC as
needed for device-specific management such as an SSP Abort Task or LUN
Reset Management request.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/Makefile | 4 | ||||
-rw-r--r-- | tools/perf/builtin-report.c | 17 | ||||
-rw-r--r-- | tools/perf/builtin-test.c | 30 | ||||
-rw-r--r-- | tools/perf/util/parse-events.l | 2 | ||||
-rw-r--r-- | tools/perf/util/symbol.c | 13 | ||||
-rwxr-xr-x | tools/testing/ktest/ktest.pl | 12 |
6 files changed, 60 insertions, 18 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile index 03059e75665a..9bf3fc759344 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile | |||
@@ -234,8 +234,8 @@ endif | |||
234 | 234 | ||
235 | export PERL_PATH | 235 | export PERL_PATH |
236 | 236 | ||
237 | FLEX = $(CROSS_COMPILE)flex | 237 | FLEX = flex |
238 | BISON= $(CROSS_COMPILE)bison | 238 | BISON= bison |
239 | 239 | ||
240 | $(OUTPUT)util/parse-events-flex.c: util/parse-events.l | 240 | $(OUTPUT)util/parse-events-flex.c: util/parse-events.l |
241 | $(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/parse-events-flex.h -t util/parse-events.l > $(OUTPUT)util/parse-events-flex.c | 241 | $(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/parse-events-flex.h -t util/parse-events.l > $(OUTPUT)util/parse-events-flex.c |
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 2e317438980b..cdae9b2db1cc 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
@@ -374,16 +374,23 @@ static int __cmd_report(struct perf_report *rep) | |||
374 | (kernel_map->dso->hit && | 374 | (kernel_map->dso->hit && |
375 | (kernel_kmap->ref_reloc_sym == NULL || | 375 | (kernel_kmap->ref_reloc_sym == NULL || |
376 | kernel_kmap->ref_reloc_sym->addr == 0))) { | 376 | kernel_kmap->ref_reloc_sym->addr == 0))) { |
377 | const struct dso *kdso = kernel_map->dso; | 377 | const char *desc = |
378 | "As no suitable kallsyms nor vmlinux was found, kernel samples\n" | ||
379 | "can't be resolved."; | ||
380 | |||
381 | if (kernel_map) { | ||
382 | const struct dso *kdso = kernel_map->dso; | ||
383 | if (!RB_EMPTY_ROOT(&kdso->symbols[MAP__FUNCTION])) { | ||
384 | desc = "If some relocation was applied (e.g. " | ||
385 | "kexec) symbols may be misresolved."; | ||
386 | } | ||
387 | } | ||
378 | 388 | ||
379 | ui__warning( | 389 | ui__warning( |
380 | "Kernel address maps (/proc/{kallsyms,modules}) were restricted.\n\n" | 390 | "Kernel address maps (/proc/{kallsyms,modules}) were restricted.\n\n" |
381 | "Check /proc/sys/kernel/kptr_restrict before running 'perf record'.\n\n%s\n\n" | 391 | "Check /proc/sys/kernel/kptr_restrict before running 'perf record'.\n\n%s\n\n" |
382 | "Samples in kernel modules can't be resolved as well.\n\n", | 392 | "Samples in kernel modules can't be resolved as well.\n\n", |
383 | RB_EMPTY_ROOT(&kdso->symbols[MAP__FUNCTION]) ? | 393 | desc); |
384 | "As no suitable kallsyms nor vmlinux was found, kernel samples\n" | ||
385 | "can't be resolved." : | ||
386 | "If some relocation was applied (e.g. kexec) symbols may be misresolved."); | ||
387 | } | 394 | } |
388 | 395 | ||
389 | if (dump_trace) { | 396 | if (dump_trace) { |
diff --git a/tools/perf/builtin-test.c b/tools/perf/builtin-test.c index 1c5b9801ac61..223ffdcc0fd8 100644 --- a/tools/perf/builtin-test.c +++ b/tools/perf/builtin-test.c | |||
@@ -851,6 +851,28 @@ static int test__checkevent_symbolic_name_modifier(struct perf_evlist *evlist) | |||
851 | return test__checkevent_symbolic_name(evlist); | 851 | return test__checkevent_symbolic_name(evlist); |
852 | } | 852 | } |
853 | 853 | ||
854 | static int test__checkevent_exclude_host_modifier(struct perf_evlist *evlist) | ||
855 | { | ||
856 | struct perf_evsel *evsel = list_entry(evlist->entries.next, | ||
857 | struct perf_evsel, node); | ||
858 | |||
859 | TEST_ASSERT_VAL("wrong exclude guest", !evsel->attr.exclude_guest); | ||
860 | TEST_ASSERT_VAL("wrong exclude host", evsel->attr.exclude_host); | ||
861 | |||
862 | return test__checkevent_symbolic_name(evlist); | ||
863 | } | ||
864 | |||
865 | static int test__checkevent_exclude_guest_modifier(struct perf_evlist *evlist) | ||
866 | { | ||
867 | struct perf_evsel *evsel = list_entry(evlist->entries.next, | ||
868 | struct perf_evsel, node); | ||
869 | |||
870 | TEST_ASSERT_VAL("wrong exclude guest", evsel->attr.exclude_guest); | ||
871 | TEST_ASSERT_VAL("wrong exclude host", !evsel->attr.exclude_host); | ||
872 | |||
873 | return test__checkevent_symbolic_name(evlist); | ||
874 | } | ||
875 | |||
854 | static int test__checkevent_symbolic_alias_modifier(struct perf_evlist *evlist) | 876 | static int test__checkevent_symbolic_alias_modifier(struct perf_evlist *evlist) |
855 | { | 877 | { |
856 | struct perf_evsel *evsel = list_entry(evlist->entries.next, | 878 | struct perf_evsel *evsel = list_entry(evlist->entries.next, |
@@ -1091,6 +1113,14 @@ static struct test__event_st { | |||
1091 | .name = "r1,syscalls:sys_enter_open:k,1:1:hp", | 1113 | .name = "r1,syscalls:sys_enter_open:k,1:1:hp", |
1092 | .check = test__checkevent_list, | 1114 | .check = test__checkevent_list, |
1093 | }, | 1115 | }, |
1116 | { | ||
1117 | .name = "instructions:G", | ||
1118 | .check = test__checkevent_exclude_host_modifier, | ||
1119 | }, | ||
1120 | { | ||
1121 | .name = "instructions:H", | ||
1122 | .check = test__checkevent_exclude_guest_modifier, | ||
1123 | }, | ||
1094 | }; | 1124 | }; |
1095 | 1125 | ||
1096 | #define TEST__EVENTS_CNT (sizeof(test__events) / sizeof(struct test__event_st)) | 1126 | #define TEST__EVENTS_CNT (sizeof(test__events) / sizeof(struct test__event_st)) |
diff --git a/tools/perf/util/parse-events.l b/tools/perf/util/parse-events.l index 05d766e3ecb5..1fcf1bbc5458 100644 --- a/tools/perf/util/parse-events.l +++ b/tools/perf/util/parse-events.l | |||
@@ -54,7 +54,7 @@ num_dec [0-9]+ | |||
54 | num_hex 0x[a-fA-F0-9]+ | 54 | num_hex 0x[a-fA-F0-9]+ |
55 | num_raw_hex [a-fA-F0-9]+ | 55 | num_raw_hex [a-fA-F0-9]+ |
56 | name [a-zA-Z_*?][a-zA-Z0-9_*?]* | 56 | name [a-zA-Z_*?][a-zA-Z0-9_*?]* |
57 | modifier_event [ukhp]{1,5} | 57 | modifier_event [ukhpGH]{1,8} |
58 | modifier_bp [rwx] | 58 | modifier_bp [rwx] |
59 | 59 | ||
60 | %% | 60 | %% |
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index c0a028c3ebaf..ab9867b2b433 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c | |||
@@ -977,8 +977,9 @@ static Elf_Scn *elf_section_by_name(Elf *elf, GElf_Ehdr *ep, | |||
977 | * And always look at the original dso, not at debuginfo packages, that | 977 | * And always look at the original dso, not at debuginfo packages, that |
978 | * have the PLT data stripped out (shdr_rel_plt.sh_type == SHT_NOBITS). | 978 | * have the PLT data stripped out (shdr_rel_plt.sh_type == SHT_NOBITS). |
979 | */ | 979 | */ |
980 | static int dso__synthesize_plt_symbols(struct dso *dso, struct map *map, | 980 | static int |
981 | symbol_filter_t filter) | 981 | dso__synthesize_plt_symbols(struct dso *dso, char *name, struct map *map, |
982 | symbol_filter_t filter) | ||
982 | { | 983 | { |
983 | uint32_t nr_rel_entries, idx; | 984 | uint32_t nr_rel_entries, idx; |
984 | GElf_Sym sym; | 985 | GElf_Sym sym; |
@@ -993,10 +994,7 @@ static int dso__synthesize_plt_symbols(struct dso *dso, struct map *map, | |||
993 | char sympltname[1024]; | 994 | char sympltname[1024]; |
994 | Elf *elf; | 995 | Elf *elf; |
995 | int nr = 0, symidx, fd, err = 0; | 996 | int nr = 0, symidx, fd, err = 0; |
996 | char name[PATH_MAX]; | ||
997 | 997 | ||
998 | snprintf(name, sizeof(name), "%s%s", | ||
999 | symbol_conf.symfs, dso->long_name); | ||
1000 | fd = open(name, O_RDONLY); | 998 | fd = open(name, O_RDONLY); |
1001 | if (fd < 0) | 999 | if (fd < 0) |
1002 | goto out; | 1000 | goto out; |
@@ -1703,8 +1701,9 @@ restart: | |||
1703 | continue; | 1701 | continue; |
1704 | 1702 | ||
1705 | if (ret > 0) { | 1703 | if (ret > 0) { |
1706 | int nr_plt = dso__synthesize_plt_symbols(dso, map, | 1704 | int nr_plt; |
1707 | filter); | 1705 | |
1706 | nr_plt = dso__synthesize_plt_symbols(dso, name, map, filter); | ||
1708 | if (nr_plt > 0) | 1707 | if (nr_plt > 0) |
1709 | ret += nr_plt; | 1708 | ret += nr_plt; |
1710 | break; | 1709 | break; |
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index 95d6a6f7c33a..4915408f6a98 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl | |||
@@ -183,6 +183,9 @@ my %force_config; | |||
183 | # do not force reboots on config problems | 183 | # do not force reboots on config problems |
184 | my $no_reboot = 1; | 184 | my $no_reboot = 1; |
185 | 185 | ||
186 | # reboot on success | ||
187 | my $reboot_success = 0; | ||
188 | |||
186 | my %option_map = ( | 189 | my %option_map = ( |
187 | "MACHINE" => \$machine, | 190 | "MACHINE" => \$machine, |
188 | "SSH_USER" => \$ssh_user, | 191 | "SSH_USER" => \$ssh_user, |
@@ -2192,7 +2195,7 @@ sub run_bisect { | |||
2192 | } | 2195 | } |
2193 | 2196 | ||
2194 | # Are we looking for where it worked, not failed? | 2197 | # Are we looking for where it worked, not failed? |
2195 | if ($reverse_bisect) { | 2198 | if ($reverse_bisect && $ret >= 0) { |
2196 | $ret = !$ret; | 2199 | $ret = !$ret; |
2197 | } | 2200 | } |
2198 | 2201 | ||
@@ -3469,6 +3472,7 @@ for (my $i = 1; $i <= $opt{"NUM_TESTS"}; $i++) { | |||
3469 | 3472 | ||
3470 | # Do not reboot on failing test options | 3473 | # Do not reboot on failing test options |
3471 | $no_reboot = 1; | 3474 | $no_reboot = 1; |
3475 | $reboot_success = 0; | ||
3472 | 3476 | ||
3473 | $iteration = $i; | 3477 | $iteration = $i; |
3474 | 3478 | ||
@@ -3554,9 +3558,11 @@ for (my $i = 1; $i <= $opt{"NUM_TESTS"}; $i++) { | |||
3554 | die "failed to checkout $checkout"; | 3558 | die "failed to checkout $checkout"; |
3555 | } | 3559 | } |
3556 | 3560 | ||
3561 | $no_reboot = 0; | ||
3562 | |||
3557 | # A test may opt to not reboot the box | 3563 | # A test may opt to not reboot the box |
3558 | if ($reboot_on_success) { | 3564 | if ($reboot_on_success) { |
3559 | $no_reboot = 0; | 3565 | $reboot_success = 1; |
3560 | } | 3566 | } |
3561 | 3567 | ||
3562 | if ($test_type eq "bisect") { | 3568 | if ($test_type eq "bisect") { |
@@ -3600,7 +3606,7 @@ for (my $i = 1; $i <= $opt{"NUM_TESTS"}; $i++) { | |||
3600 | 3606 | ||
3601 | if ($opt{"POWEROFF_ON_SUCCESS"}) { | 3607 | if ($opt{"POWEROFF_ON_SUCCESS"}) { |
3602 | halt; | 3608 | halt; |
3603 | } elsif ($opt{"REBOOT_ON_SUCCESS"} && !do_not_reboot) { | 3609 | } elsif ($opt{"REBOOT_ON_SUCCESS"} && !do_not_reboot && $reboot_success) { |
3604 | reboot_to_good; | 3610 | reboot_to_good; |
3605 | } elsif (defined($switch_to_good)) { | 3611 | } elsif (defined($switch_to_good)) { |
3606 | # still need to get to the good kernel | 3612 | # still need to get to the good kernel |