[PATCH 7/8] perf tools: Fix bug when --raw-dump is not the first arguement for perf list.
From: Dongsheng Yang
Date: Fri Dec 27 2013 - 05:07:49 EST
As we use PARSE_OPT_STOP_AT_NON_OPTION option in parse_option(), if --raw-dump
is not the first argument, it will be treat as an argument rather than option.
Example:
# ./perf list kvmmmu --raw-dump
kvmmmu:kvm_mmu_pagetable_walk [Tracepoint event]
kvmmmu:kvm_mmu_paging_element [Tracepoint event]
kvmmmu:kvm_mmu_set_accessed_bit [Tracepoint event]
kvmmmu:kvm_mmu_set_dirty_bit [Tracepoint event]
kvmmmu:kvm_mmu_walker_error [Tracepoint event]
kvmmmu:kvm_mmu_get_page [Tracepoint event]
kvmmmu:kvm_mmu_sync_page [Tracepoint event]
kvmmmu:kvm_mmu_unsync_page [Tracepoint event]
kvmmmu:kvm_mmu_prepare_zap_page [Tracepoint event]
kvmmmu:mark_mmio_spte [Tracepoint event]
kvmmmu:handle_mmio_page_fault [Tracepoint event]
kvmmmu:fast_page_fault [Tracepoint event]
This patch replace PARSE_OPT_STOP_AT_NON_OPTION as 0, then we can parse it even if
it is not the first argument.
Verification:
# ./perf list kvmmmu --raw-dump
kvmmmu:kvm_mmu_pagetable_walk kvmmmu:kvm_mmu_paging_element
kvmmmu:kvm_mmu_set_accessed_bit kvmmmu:kvm_mmu_set_dirty_b
it kvmmmu:kvm_mmu_walker_error kvmmmu:kv
Signed-off-by: Dongsheng Yang <yangds.fnst@xxxxxxxxxxxxxx>
---
tools/perf/builtin-list.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c
index ec90d0a..9430666 100644
--- a/tools/perf/builtin-list.c
+++ b/tools/perf/builtin-list.c
@@ -30,8 +30,7 @@ int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused)
NULL
};
- argc = parse_options(argc, argv, list_options, list_usage,
- PARSE_OPT_STOP_AT_NON_OPTION);
+ argc = parse_options(argc, argv, list_options, list_usage, 0);
setup_pager();
--
1.8.2.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/