From patchwork Mon Feb 12 20:32:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 128168 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp3565759ljc; Mon, 12 Feb 2018 12:32:49 -0800 (PST) X-Google-Smtp-Source: AH8x224BHCvdup/LOoZUt/4uixH/ZkhuDjThH9BiCYwuSox/uJMKLmnqj8uM5ZtlacCtANFAk69a X-Received: by 2002:a17:902:32a2:: with SMTP id z31-v6mr11907084plb.345.1518467568863; Mon, 12 Feb 2018 12:32:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518467568; cv=none; d=google.com; s=arc-20160816; b=ETx1UjrDVo2J+/ZeX3O06dkxnRGrlRUGvoCyDSGB/dyLS23uWCzg8V0yhsOsRE6gNr dGv5ctRNTKnjkO6bLMNc9oepi5fezOobmGoMK+ryNjlIwRYZtzjdIvdVxmID4bSJB/CH ShcqUk1MBtDb0KBmHCPXVIEQlwdhDuy5zdq/0uguuZPsHayplMkJNmXTqXJPiD865Dlm ujfM+ZUeo7y1BVaJJa/IlqWYNzuSH1GJsMN6jAfx2438ZIDjkrMuGTsOldSwvpZWxrkw 3i/J6/7Zr7Lm4iZsCi3U6tiX9ruuo1U8iW7KHUWb4WTaxzPgKWst7c6V7W06o6dMFT2C kiXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=a5/HP10kcS8rrlT8+jHyREHI2Z0DyTHsKu6Dx+CnsX0=; b=flQ14mRVxBenjlpLiXFd4/rULyes1DqK7f7stON4mKg7BUmJls9jObzs/o6cnaoaYf I0wPSV7tUi4dAMC9Ap6rC8ftuIIp5KuQHA5X4zoPpSU1mjipM9yMZEJb+eT4Og7iapUr INQDTeHd4Cn869plo70eNSfQidduohdIBVOJvdNhpjzesnAQ0ve8uTlpu6MlTePoYkrs t2ZDe8KvgU5yz0R8tmteel7pq5nLlnF+i7O69ZAvdePRrU16nmHuRLMQ3MaKPi/wP0hH 9PeFNf0xrbAYQJO0CFjga9Di518HvPR7W5pdOZeM438yXdWN7/rHeFCbwc8OGJxXA6gd BLxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IbSaS4dR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z6-v6si164693plo.200.2018.02.12.12.32.48; Mon, 12 Feb 2018 12:32:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IbSaS4dR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753931AbeBLUcn (ORCPT + 26 others); Mon, 12 Feb 2018 15:32:43 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:35709 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753193AbeBLUcl (ORCPT ); Mon, 12 Feb 2018 15:32:41 -0500 Received: by mail-pg0-f67.google.com with SMTP id l131so2732703pga.2 for ; Mon, 12 Feb 2018 12:32:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=a5/HP10kcS8rrlT8+jHyREHI2Z0DyTHsKu6Dx+CnsX0=; b=IbSaS4dRXpU+hHaOJ3zAAwQio14jw5ZMbuWOTdEJGooFjhIgNreA1RFR73ZyCDQa/r POxJizDu1rWw7fapsoqB91MleKM/sABj6r0C1gw0zJUTy8HDupb9IW5LPzSYHazQmZ8W gFzIm5fWdC3hp+H9OmbsULzdixATOXNxV1XgU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=a5/HP10kcS8rrlT8+jHyREHI2Z0DyTHsKu6Dx+CnsX0=; b=VSPQuTFXxGQG3dU1CaX1Lf8vGx+/AIw0EqSpzNAyOHpqkkJJIsFGcnjdOHqqo0qk7S DRuLFsoIHi11g9ITdfwWs7ALtgukMpQwbcx0/N+QMuKE/hSNPKGtXVeXW0oBZZCStmrm 7cQGfOqSSrnBmHujforKRWFwupwrXnS3/bkJd7tnsWSY148EkpBoFJgCo7EYP6k8iHl+ Ig7yJ7QhD5gpQ47PauNgD/74dMMuuCB1xX9pOwj2Zw7lCADsw3O+EUAxMfvU+raMnnMo /6Ay4YqduLM7CZ45TSRhW18+N/34UxjzSb9XUo6kH+3BGZDm5EDTxSn9bLbu2ZVXG56p U0hw== X-Gm-Message-State: APf1xPBw4vK3coNrAEhls47n21naBAw1q8rKwmozzvZl9uTrScl385a5 AYcTPiH6mAKMZXnZttsNkQBbsDO3hNk= X-Received: by 10.98.144.213 with SMTP id q82mr12782612pfk.37.1518467560792; Mon, 12 Feb 2018 12:32:40 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id c8sm12856594pgn.72.2018.02.12.12.32.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Feb 2018 12:32:40 -0800 (PST) From: Mathieu Poirier To: acme@kernel.org Cc: peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, namhyung@kernel.org, yao.jin@linux.intel.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] perf tools: Freeing allocated memory Date: Mon, 12 Feb 2018 13:32:35 -0700 Message-Id: <1518467557-18505-2-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518467557-18505-1-git-send-email-mathieu.poirier@linaro.org> References: <1518467557-18505-1-git-send-email-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch frees all the memory allocated in function cs_etm__alloc_queue(). Signed-off-by: Mathieu Poirier --- tools/perf/util/cs-etm.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.7.4 diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index b9f0a53dfa65..f2c98774e665 100644 --- a/tools/perf/util/cs-etm.c +++ b/tools/perf/util/cs-etm.c @@ -174,6 +174,12 @@ static void cs_etm__free_queue(void *priv) { struct cs_etm_queue *etmq = priv; + if (!etmq) + return; + + thread__zput(etmq->thread); + cs_etm_decoder__free(etmq->decoder); + zfree(&etmq->event_buf); free(etmq); } From patchwork Mon Feb 12 20:32:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 128170 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp3565914ljc; Mon, 12 Feb 2018 12:33:04 -0800 (PST) X-Google-Smtp-Source: AH8x2275p7bSCGdfoOuJTfojB+Jx3g7l7RTRN+W+kOhPjW69rNtkzWAnzEvib2PfElfiPSBxhq2/ X-Received: by 10.98.170.15 with SMTP id e15mr12693384pff.207.1518467584167; Mon, 12 Feb 2018 12:33:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518467584; cv=none; d=google.com; s=arc-20160816; b=CWgXNeYUWdRK870lvt/Gam3TgTQj+w+truCnE19YMuQ6PGkPw+OS92cva8WlHqJG9C r5WRtTWnyVqRccPbutLWjgm5d2GZkIfQLNzBQLmwmBzxdv1kRoOWwsl1sA7YQzTk55f8 fY/9AZIsCuu6JgXV6lgU6q4jNkZdlFYqnIyjUO78tPWNpExWhRfa5YFY6nICetLs4VHI aJFNSjrGOoEtfFV+AoMFxHBmPg/XsKCufFlUJZhTr7pJCLefJWIGbQkI/FyDnBPLzzQy MqUhygB7XFDjkYrgB2htZthevssKSXaIdNvIWjQxXVbzcVP8GwRG453voqvt36unFwOa 33Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=YYPAqs8d/WW1nFR7OPHcYzEd+6+zK3sP6g9s1hNcH7Q=; b=wvpz/YuOpIxbG/MzPrSRUxaedS91MsdgAloNdrYeNZ5EImx7+baxybyGBNxICkf0u3 7cno40DFktYkqa4qSueka+hsyQ3X/gOOkZ9+GyJ+hxPAPG6+CPigQZmsM7QHORMy9grr oomBmqV+zQugK7uxK8L6MzV20qTQHoI5TqBl1xdCRVf5WgYnUFmircpT8Qimvj64shFo aRW1Z+7sxSF2qNVKt6UrLc/A79FELX54xuEW2btjNCNMgv+folySgIAVymmq241C12e5 6wHIuVrbIBk5DpPznz8fALJaVirDhfPSBfuHe7UPKPPJa0I479T5p+b6axvp8aT3Q643 O5Jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KEYa0zoT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u73si2655949pgc.381.2018.02.12.12.33.03; Mon, 12 Feb 2018 12:33:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KEYa0zoT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754021AbeBLUcr (ORCPT + 26 others); Mon, 12 Feb 2018 15:32:47 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:37790 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753871AbeBLUcn (ORCPT ); Mon, 12 Feb 2018 15:32:43 -0500 Received: by mail-pg0-f68.google.com with SMTP id o1so8258324pgn.4 for ; Mon, 12 Feb 2018 12:32:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=YYPAqs8d/WW1nFR7OPHcYzEd+6+zK3sP6g9s1hNcH7Q=; b=KEYa0zoTw9Toun7jWXIPUsBR8LpI03Mnv1XgrxjUehm6ELz97d3M78cRgplUG9r13X SJh+ALrR9XcbWuQCirwcv1qq6QN/NT55WGR+hOS0p+4pjdYkSflLTIXIvq6XOL+J823K SaZbYjKc4scZz031wzf2tRkBTh5KtSG/3qRTM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=YYPAqs8d/WW1nFR7OPHcYzEd+6+zK3sP6g9s1hNcH7Q=; b=PTkvz4QSqIffhic4nwlIGCVmUFm+F1Kg7Ol548lmzWPmulIKS9B4IK4P6XpHzWtm2r W11Ues3dycamaKk7TY+4NMB2yU7CAPc5DnQ+QYHxe91FCvvK2rHDf8YU7Asd9Ii/XxO8 9W9E66QzuZ4Bwgk3mQhz44UXYdvoQaP3WuuGHWcSA7+sJLP7XofzOgAbz8AB+c/1yuGt YiW7AGEAIRFcoxeL5IkDGWj2u8nboUHU/4c9/Fz+d+h6x3sumObyUV0InYoSmaI0NjHb yCFz4c4R82s+4iQJRgQK2VVmAxx/EPiaTpnFaAQSU2MH0MA6a96LYm119yzgShOSOh1X 98iQ== X-Gm-Message-State: APf1xPBj6knKiwcO6PLbof2b+RoOxvQwRLbYln5+PRTNzmjZwq0Ots6l jtMNui3Oapeq26FHavHwuknTLA== X-Received: by 10.101.90.8 with SMTP id y8mr10089443pgs.34.1518467562513; Mon, 12 Feb 2018 12:32:42 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id c8sm12856594pgn.72.2018.02.12.12.32.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Feb 2018 12:32:41 -0800 (PST) From: Mathieu Poirier To: acme@kernel.org Cc: peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, namhyung@kernel.org, yao.jin@linux.intel.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] perf util: Use target->per_thread and target->system_wide flags Date: Mon, 12 Feb 2018 13:32:36 -0700 Message-Id: <1518467557-18505-3-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518467557-18505-1-git-send-email-mathieu.poirier@linaro.org> References: <1518467557-18505-1-git-send-email-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jin Yao Mathieu Poirier reports issue in commit ("73c0ca1eee3d perf thread_map: Enumerate all threads from /proc") that it has negative impact on 'perf record --per-thread'. It has the effect of creating a kernel event for each thread in the system for 'perf record --per-thread'. Mathieu Poirier's patch ("perf util: Do not reuse target->per_thread flag") can fix this issue by creating a new target->all_threads flag. This patch is based on Mathieu Poirier's patch but it doesn't use a new target->all_threads flag. This patch just uses 'target->per_thread && target->system_wide' as a condition to check for all threads case. Signed-off-by: Jin Yao [Fixed checkpatch warning about line over 80 characters] Signed-off-by: Mathieu Poirier --- tools/perf/util/evlist.c | 21 ++++++++++++++++++++- tools/perf/util/thread_map.c | 4 ++-- tools/perf/util/thread_map.h | 2 +- 3 files changed, 23 insertions(+), 4 deletions(-) -- 2.7.4 diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index e5fc14e53c05..7b7d535396f7 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -1086,11 +1086,30 @@ int perf_evlist__mmap(struct perf_evlist *evlist, unsigned int pages) int perf_evlist__create_maps(struct perf_evlist *evlist, struct target *target) { + bool all_threads = (target->per_thread && target->system_wide); struct cpu_map *cpus; struct thread_map *threads; + /* + * If specify '-a' and '--per-thread' to perf record, perf record + * will override '--per-thread'. target->per_thread = false and + * target->system_wide = true. + * + * If specify '--per-thread' only to perf record, + * target->per_thread = true and target->system_wide = false. + * + * So target->per_thread && target->system_wide is false. + * For perf record, thread_map__new_str doesn't call + * thread_map__new_all_cpus. That will keep perf record's + * current behavior. + * + * For perf stat, it allows the case that target->per_thread and + * target->system_wide are all true. It means to collect system-wide + * per-thread data. thread_map__new_str will call + * thread_map__new_all_cpus to enumerate all threads. + */ threads = thread_map__new_str(target->pid, target->tid, target->uid, - target->per_thread); + all_threads); if (!threads) return -1; diff --git a/tools/perf/util/thread_map.c b/tools/perf/util/thread_map.c index 3e1038f6491c..729dad8f412d 100644 --- a/tools/perf/util/thread_map.c +++ b/tools/perf/util/thread_map.c @@ -323,7 +323,7 @@ struct thread_map *thread_map__new_by_tid_str(const char *tid_str) } struct thread_map *thread_map__new_str(const char *pid, const char *tid, - uid_t uid, bool per_thread) + uid_t uid, bool all_threads) { if (pid) return thread_map__new_by_pid_str(pid); @@ -331,7 +331,7 @@ struct thread_map *thread_map__new_str(const char *pid, const char *tid, if (!tid && uid != UINT_MAX) return thread_map__new_by_uid(uid); - if (per_thread) + if (all_threads) return thread_map__new_all_cpus(); return thread_map__new_by_tid_str(tid); diff --git a/tools/perf/util/thread_map.h b/tools/perf/util/thread_map.h index 0a806b99e73c..5ec91cfd1869 100644 --- a/tools/perf/util/thread_map.h +++ b/tools/perf/util/thread_map.h @@ -31,7 +31,7 @@ struct thread_map *thread_map__get(struct thread_map *map); void thread_map__put(struct thread_map *map); struct thread_map *thread_map__new_str(const char *pid, - const char *tid, uid_t uid, bool per_thread); + const char *tid, uid_t uid, bool all_threads); struct thread_map *thread_map__new_by_tid_str(const char *tid_str); From patchwork Mon Feb 12 20:32:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 128169 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp3565817ljc; Mon, 12 Feb 2018 12:32:54 -0800 (PST) X-Google-Smtp-Source: AH8x224I2wKL+CKB6Pk/WD81z6Lq8XhtMgBz4cH+JKGwVBojfsjSl4oJUO7qaJAe7CfWxY39WLUA X-Received: by 10.99.120.134 with SMTP id t128mr10353631pgc.313.1518467574380; Mon, 12 Feb 2018 12:32:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518467574; cv=none; d=google.com; s=arc-20160816; b=RhYexu8/evmzFu3bHcyb/yGGQBdrsKNeOFtFG1CV3EI+8KukB33+CWUW5oPLk8e0hz ZIRws9HYmbQQAGh/UWLzb9gegkRG3hgfwCxj1zFidKXvta4pmlPtuGDk06rwXPqoBjmV AL1EEq/X6uPKa6Fj+TzllolsVps/w14EffEZh4A7Xph3b0Z2ZDIjy+ko3HLl4YeUwpM7 c9pXaWu3yrzlXWH6/yvmzIzEK8IDjl6uP24myPDs2seBk+efwHhrizHsv9+CIvTL5muy HixbvATED8KSbDVguVJVsgfk0hFgB4uWoXqpf6alC47sL1nwditn2ZppABsQt7cpJE5F 3IBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=isG6eeZ1XXZZZakKFHsXwGZfK52M7xc/g2y3D4CCZyw=; b=TXx7m247Q2SJ3mF9MseG8Vy2rFieybMj5f08Z954M12CqllzV9CvcOBoBWfkWHwvAb K4LPGPlk3oyK6dqtfXH3quRfmOLf68Yt8QQ0QBRzHZqxHBnpvOZmaTxm8FJKdixQCFtm /vSw3m9k7Q6O2Zzftk4E9hdms5wOZ1N5OI4ifclS8LZhRKuRWHH7qsHZznNiiZpvSI4F wZ+OiDZl8CRyOtOyFpgqmOQtDxU5dnwBkvrzO9cyDQJ362ST32tT6/mcaRdAaViezW1U LYREdyZxst+e8+X2l1J1mNc1J5SvXxVRaI4PQewm68x3D66aCXe9kwnRBNfp6UNuLTa+ g/KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WXc/u3rj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u73si2655949pgc.381.2018.02.12.12.32.54; Mon, 12 Feb 2018 12:32:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WXc/u3rj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754048AbeBLUcu (ORCPT + 26 others); Mon, 12 Feb 2018 15:32:50 -0500 Received: from mail-pl0-f67.google.com ([209.85.160.67]:38511 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753193AbeBLUco (ORCPT ); Mon, 12 Feb 2018 15:32:44 -0500 Received: by mail-pl0-f67.google.com with SMTP id m19so612931pls.5 for ; Mon, 12 Feb 2018 12:32:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=isG6eeZ1XXZZZakKFHsXwGZfK52M7xc/g2y3D4CCZyw=; b=WXc/u3rjHjm906BFAyGwVHa05S+YWldKC6bHxzjI/PhjQJKvR0rUaN7Bw5FM5cjnUA TNAFgznN72KeTdnZ7Olxd0LZl7WHxseSnO5K6YpGBMB3gPFyFCgFNzjQE81GgwB9QU4I aZMkYzfmqtSJsSiNx0907HwGbbOQ35LeFf614= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=isG6eeZ1XXZZZakKFHsXwGZfK52M7xc/g2y3D4CCZyw=; b=kSMWM6OLdV1+f8BQaGy/H2eaarlaOLNhccV8EUBvDAFBiCatuphcAPZQR7gYorLJhy K14nmgP6P5sPrkv6cBr7rLj4zVONdmxMzEmKVb4BhhWHUYPduyrCSwy74O4lQWO3Wh6t Ywg9a+31pkm+/HPl3++e7DamxZQwEkZPuNMY8HPEyG1NAif0GOQTBF/Cj7fVXMDeUORy gfmOzTT3bMP9jsoFOaHDdM0+fF2Ek21ayEhI0rhg0NXvGzNE33w8IOgIxRKxB+dmRmAe ETTYPTWEAHGI80c2/q+GRn4KMtKoOs5cVE/e2siVGj6x+oNYN1YgK8LtsxJT0/YAmDIu x36Q== X-Gm-Message-State: APf1xPCnK2BUxGzPn/uWEFUNRUA3u1f0hcAEE+EFEmpndOWv6nHE+fm0 fgs/PkoxsRqv9M18z37fvvUFYQ== X-Received: by 2002:a17:902:7848:: with SMTP id e8-v6mr11938396pln.386.1518467563953; Mon, 12 Feb 2018 12:32:43 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id c8sm12856594pgn.72.2018.02.12.12.32.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Feb 2018 12:32:43 -0800 (PST) From: Mathieu Poirier To: acme@kernel.org Cc: peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, namhyung@kernel.org, yao.jin@linux.intel.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] perf tools: Fixing uninitialised variable Date: Mon, 12 Feb 2018 13:32:37 -0700 Message-Id: <1518467557-18505-4-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518467557-18505-1-git-send-email-mathieu.poirier@linaro.org> References: <1518467557-18505-1-git-send-email-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When working natively on arm64 the compiler gets pesky and complains that variable 'i' is uninitialised, something that breaks the compilation. Here no further checks are needed since variable 'found_spe' can only be true if variable 'i' has been initialised as part of the for loop. Signed-off-by: Mathieu Poirier --- tools/perf/arch/arm/util/auxtrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 diff --git a/tools/perf/arch/arm/util/auxtrace.c b/tools/perf/arch/arm/util/auxtrace.c index 2323581b157d..fa639e3e52ac 100644 --- a/tools/perf/arch/arm/util/auxtrace.c +++ b/tools/perf/arch/arm/util/auxtrace.c @@ -68,7 +68,7 @@ struct auxtrace_record bool found_spe = false; static struct perf_pmu **arm_spe_pmus = NULL; static int nr_spes = 0; - int i; + int i = 0; if (!evlist) return NULL;