lkml.org 
[lkml]   [2015]   [Aug]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V2 2/2] perf,test: test cpu topology
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
>


\
 
 \ /
  Last update: 2015-08-29 13:21    [W:0.051 / U:1.952 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site