From patchwork Thu Mar 25 08:47:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yanmin Zhang X-Patchwork-Id: 88168 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2P8lM5v027365 for ; Thu, 25 Mar 2010 08:47:23 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753255Ab0CYIq5 (ORCPT ); Thu, 25 Mar 2010 04:46:57 -0400 Received: from mga10.intel.com ([192.55.52.92]:5318 "EHLO fmsmga102.fm.intel.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751651Ab0CYIqz (ORCPT ); Thu, 25 Mar 2010 04:46:55 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 25 Mar 2010 01:43:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.51,306,1267430400"; d="scan'208";a="551973289" Received: from ymzhang.sh.intel.com (HELO [10.239.13.36]) ([10.239.13.36]) by fmsmga002.fm.intel.com with ESMTP; 25 Mar 2010 01:45:34 -0700 Subject: Re: [PATCH 3/3] perf events: Change perf parameter --pid to process-wide collection instead of thread-wide From: "Zhang, Yanmin" To: Li Zefan Cc: Ingo Molnar , Arnaldo Carvalho de Melo , Avi Kivity , Peter Zijlstra , linux-kernel@vger.kernel.org, Sheng Yang , oerg Roedel , Jes Sorensen , Marcelo Tosatti , Gleb Natapov , kvm@vger.kernel.org, zhiteng.huang@intel.com, Zachary Amsden In-Reply-To: <4BAB1881.8020500@cn.fujitsu.com> References: <1268904666.2813.172.camel@localhost> <4BAB1881.8020500@cn.fujitsu.com> Date: Thu, 25 Mar 2010 16:47:44 +0800 Message-Id: <1269506864.2078.75.camel@ymzhang.sh.intel.com> Mime-Version: 1.0 X-Mailer: Evolution 2.28.0 (2.28.0-2.fc12) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 25 Mar 2010 08:47:23 +0000 (UTC) diff -Nraup linux-2.6_tip0324/tools/perf/builtin-record.c linux-2.6_tip0324_perfkvm/tools/perf/builtin-record.c --- linux-2.6_tip0324/tools/perf/builtin-record.c 2010-03-25 10:58:13.308912201 +0800 +++ linux-2.6_tip0324_perfkvm/tools/perf/builtin-record.c 2010-03-25 16:14:18.201475298 +0800 @@ -751,7 +751,7 @@ int cmd_record(int argc, const char **ar for (i = 0; i < MAX_NR_CPUS; i++) { for (j = 0; j < MAX_COUNTERS; j++) { fd[i][j] = malloc(sizeof(int)*thread_num); - mmap_array[i][j] = malloc( + mmap_array[i][j] = zalloc( sizeof(struct mmap_data)*thread_num); if (!fd[i][j] || !mmap_array[i][j]) return -ENOMEM; diff -Nraup linux-2.6_tip0324/tools/perf/builtin-top.c linux-2.6_tip0324_perfkvm/tools/perf/builtin-top.c --- linux-2.6_tip0324/tools/perf/builtin-top.c 2010-03-25 10:58:13.284848937 +0800 +++ linux-2.6_tip0324_perfkvm/tools/perf/builtin-top.c 2010-03-25 16:14:56.875266645 +0800 @@ -1371,7 +1371,7 @@ int cmd_top(int argc, const char **argv, for (i = 0; i < MAX_NR_CPUS; i++) { for (j = 0; j < MAX_COUNTERS; j++) { fd[i][j] = malloc(sizeof(int)*thread_num); - mmap_array[i][j] = malloc( + mmap_array[i][j] = zalloc( sizeof(struct mmap_data)*thread_num); if (!fd[i][j] || !mmap_array[i][j]) return -ENOMEM;