[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87vc3s1uxj.fsf@sejong.aot.lge.com>
Date: Tue, 30 Jul 2013 14:24:56 +0900
From: Namhyung Kim <namhyung@...nel.org>
To: Adrian Hunter <adrian.hunter@...el.com>
Cc: Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
linux-kernel@...r.kernel.org, David Ahern <dsahern@...il.com>,
Frederic Weisbecker <fweisbec@...il.com>,
Jiri Olsa <jolsa@...hat.com>, Mike Galbraith <efault@....de>,
Paul Mackerras <paulus@...ba.org>,
Peter Zijlstra <peterz@...radead.org>,
Stephane Eranian <eranian@...gle.com>,
Ingo Molnar <mingo@...nel.org>
Subject: Re: [PATCH 8/9] perf tools: add kcore to the object code reading test
On Thu, 25 Jul 2013 17:01:29 +0300, Adrian Hunter wrote:
> Make the "object code reading" test attempt to read from
> kcore.
>
> The test uses objdump which struggles with kcore. i.e.
> doesn't always work, sometimes takes a long time.
> The test has been made to work around those issues.
>
[SNIP]
> - if (al.map->dso->symtab_type == DSO_BINARY_TYPE__KALLSYMS) {
> + if (al.map->dso->symtab_type == DSO_BINARY_TYPE__KALLSYMS &&
> + !dso__is_kcore(al.map->dso)) {
I was confused. So this means that the symbols came from the kallsyms
but actual binary data came from the kcore, right?
> pr_debug("Unexpected kernel address - skipping\n");
> return 0;
> }
[SNIP]
> +
> + /* 2nd time through we just try kcore */
> + if (try_kcore && !have_kcore)
> + return TEST_CODE_READING_NO_KCORE;
> +
> + /* No point getting kernel events if there is no kernel object */
> + if (!have_vmlinux && !have_kcore)
> excl_kernel = true;
>
> threads = thread_map__new_by_tid(pid);
> @@ -457,8 +502,12 @@ static int do_test_code_reading(void)
> if (ret < 0)
> goto out_err;
>
> - if (!have_vmlinux)
> + if (!have_vmlinux && !have_kcore && !try_kcore)
> + err = TEST_CODE_READING_NO_KERNEL_OBJ;
> + else if (!have_vmlinux && !try_kcore)
> err = TEST_CODE_READING_NO_VMLINUX;
> + else if (!have_kcore && try_kcore)
> + err = TEST_CODE_READING_NO_KCORE;
It seems that the above line is not reachable since we already bailed
out the second test if we don't have kcore.
> else if (excl_kernel)
> err = TEST_CODE_READING_NO_ACCESS;
> else
> @@ -485,7 +534,9 @@ int test__code_reading(void)
> {
> int ret;
>
> - ret = do_test_code_reading();
> + ret = do_test_code_reading(false);
> + if (!ret)
Shouldn't it be
if (ret)
?
Thanks,
Namhyung
> + ret = do_test_code_reading(true);
>
> switch (ret) {
> case TEST_CODE_READING_OK:
> @@ -493,9 +544,15 @@ int test__code_reading(void)
> case TEST_CODE_READING_NO_VMLINUX:
> fprintf(stderr, " (no vmlinux)");
> return 0;
> + case TEST_CODE_READING_NO_KCORE:
> + fprintf(stderr, " (no kcore)");
> + return 0;
> case TEST_CODE_READING_NO_ACCESS:
> fprintf(stderr, " (no access)");
> return 0;
> + case TEST_CODE_READING_NO_KERNEL_OBJ:
> + fprintf(stderr, " (no kernel obj)");
> + return 0;
> default:
> return -1;
> };
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists