Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752888AbbH2Krz (ORCPT ); Sat, 29 Aug 2015 06:47:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55540 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752857AbbH2Kry (ORCPT ); Sat, 29 Aug 2015 06:47:54 -0400 Date: Sat, 29 Aug 2015 12:47:49 +0200 From: Jiri Olsa To: Kan Liang Cc: acme@kernel.org, jolsa@kernel.org, ak@linux.intel.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH V2 2/2] perf,test: test cpu topology Message-ID: <20150829104749.GE1787@krava.brq.redhat.com> References: <1440769419-48409-1-git-send-email-kan.liang@intel.com> <1440769419-48409-2-git-send-email-kan.liang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1440769419-48409-2-git-send-email-kan.liang@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1183 Lines: 40 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/