Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1215754

Re: [PATCH V2 2/2] perf,test: test cpu topology

From Jiri Olsa <jolsa@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH V2 2/2] perf,test: test cpu topology
Date 2015-08-29 12:50 +0200
Message-ID <q2LRT-7Ou-3@gated-at.bofh.it> (permalink)
References <q2yUG-60W-9@gated-at.bofh.it> <q2z4l-6rs-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Aug 28, 2015 at 09:43:39AM -0400, Kan Liang wrote:

SNIP

> +	TEST_ASSERT_VAL("failed to get system cpumap", !(map == NULL));
> +
> +	file.mode = PERF_DATA_MODE_READ;
> +	session = perf_session__new(&file, false, NULL);
> +	TEST_ASSERT_VAL("can't get session", session);
> +
> +	for (i = 0; i < session->header.env.nr_cpus_online; i++) {
> +		pr_debug("CPU %d, core %d, socket %d\n", i,
> +			 session->header.env.cpu[i].core_id,
> +			 session->header.env.cpu[i].socket_id);
> +	}
> +
> +	for (i = 0; i < map->nr; i++) {
> +		TEST_ASSERT_VAL("Core ID doesn't match",
> +			(session->header.env.cpu[map->map[i]].core_id == (cpu_map__get_core(map, i) & 0xffff)));
> +
> +		TEST_ASSERT_VAL("Socket ID doesn't match",
> +			(session->header.env.cpu[map->map[i]].socket_id == cpu_map__get_socket(map, i)));
> +	}
> +
> +	perf_session__delete(session);
> +	cpu_map__put(map);

	unlink(path);

> +
> +	return 0;
> +}
> -- 
> 1.8.3.1
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH V2 1/2] perf,tools: store cpu socket_id and core_id in perf.date Kan Liang <kan.liang@intel.com> - 2015-08-28 23:00 +0200
  [PATCH V2 2/2] perf,test: test cpu topology Kan Liang <kan.liang@intel.com> - 2015-08-28 23:10 +0200
    Re: [PATCH V2 2/2] perf,test: test cpu topology Jiri Olsa <jolsa@redhat.com> - 2015-08-29 12:50 +0200
  Re: [PATCH V2 1/2] perf,tools: store cpu socket_id and core_id in  perf.date Jiri Olsa <jolsa@redhat.com> - 2015-08-29 12:50 +0200
    RE: [PATCH V2 1/2] perf,tools: store cpu socket_id and core_id in  perf.date "Liang, Kan" <kan.liang@intel.com> - 2015-08-31 19:20 +0200

csiph-web