From patchwork Thu Aug 11 19:47:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 73818 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp275649qga; Thu, 11 Aug 2016 12:48:10 -0700 (PDT) X-Received: by 10.66.16.97 with SMTP id f1mr19975752pad.39.1470944890172; Thu, 11 Aug 2016 12:48:10 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p6si4616631pfi.102.2016.08.11.12.48.09; Thu, 11 Aug 2016 12:48:10 -0700 (PDT) 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; 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 dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932501AbcHKTrz (ORCPT + 27 others); Thu, 11 Aug 2016 15:47:55 -0400 Received: from mail-it0-f48.google.com ([209.85.214.48]:35746 "EHLO mail-it0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752087AbcHKTr1 (ORCPT ); Thu, 11 Aug 2016 15:47:27 -0400 Received: by mail-it0-f48.google.com with SMTP id u186so5491343ita.0 for ; Thu, 11 Aug 2016 12:47:26 -0700 (PDT) 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=UF4MPP9337dSg3zuJ4fVor5z3asIOlTyagrS0ZCHuhI=; b=c/nU4EtArXtJRhNsdC+Qwyz8I+YjPpbguUHFQXzTPktVyvtqhQqpGeLjFi+JUrJm9O /lBV0l8o0UJbT7vp2VC4bzF+DSAkP/W59dZ/NqVAzTJB3OniFkOPUaiqsJ+EKgKivruS xjup27HAGatqGBZJPCEv8v0o3zp6mlBEXeNqs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=UF4MPP9337dSg3zuJ4fVor5z3asIOlTyagrS0ZCHuhI=; b=G4JTHjcyHNozUG/8l0WhTHp0+rBWA/vfdyoZT68QwN1H9JD4yPZdsqPCTEo9KF3BOE aBE3JIvCvY26vNpVRZx7vje4k3XcKoMdLXzXrAgg0NyWGVK0E4OJ4EpW0O3il/3Amda1 PXhfbSvA9hErvDm5jQ3WZc5ljwpPgOQB3D3KGrBQVS0OkRbdxLftX77g/dtDiTlW/554 zMytZ4L868t8wKeO8T6rAJrz5leUc49QKnGeMaT7dzR+tb+GLxcDIndq3eCvWqb1kRWp DOJXntcjDP08lUQpNQB0nJrwGHB0QEUAdFEaoQfvy6dLjgu7g8f41Gei1W4Nv9y2E8pQ jIxw== X-Gm-Message-State: AEkoouu7HmMBzSXjw1al3znSGEKQvMXOwMi5EmCcOYS1gpXg2ZM3n6MIvi3YZnUgj7cGlVc7 X-Received: by 10.36.23.210 with SMTP id 201mr12287656ith.18.1470944846388; Thu, 11 Aug 2016 12:47:26 -0700 (PDT) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id 16sm1973750iol.23.2016.08.11.12.47.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 11 Aug 2016 12:47:25 -0700 (PDT) From: Mathieu Poirier To: peterz@infradead.org Cc: mingo@redhat.com, alexander.shishkin@linux.intel.com, linux-kernel@vger.kernel.org Subject: [PATCH V3 1/3] perf/core: Fixing filename for start/stop filters Date: Thu, 11 Aug 2016 13:47:21 -0600 Message-Id: <1470944843-7575-2-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1470944843-7575-1-git-send-email-mathieu.poirier@linaro.org> References: <1470944843-7575-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 Binary file names have to be supplied for both range and start/stop filters but the current code only process the filename if an address range filter is specified. This code adds processing of the filename for start/stop filters. Signed-off-by: Mathieu Poirier Acked-by: Alexander Shishkin --- kernel/events/core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/kernel/events/core.c b/kernel/events/core.c index a19550d80ab1..0662279c5729 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -7905,8 +7905,10 @@ perf_event_parse_addr_filter(struct perf_event *event, char *fstr, goto fail; } - if (token == IF_SRC_FILE) { - filename = match_strdup(&args[2]); + if (token == IF_SRC_FILE || token == IF_SRC_FILEADDR) { + int fpos = filter->range ? 2 : 1; + + filename = match_strdup(&args[fpos]); if (!filename) { ret = -ENOMEM; goto fail;