From patchwork Mon Jul 18 16:43:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 72218 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp206905qga; Mon, 18 Jul 2016 09:44:49 -0700 (PDT) X-Received: by 10.36.207.214 with SMTP id y205mr52310570itf.37.1468860282779; Mon, 18 Jul 2016 09:44:42 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 77si10194807itf.109.2016.07.18.09.44.42; Mon, 18 Jul 2016 09:44:42 -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 S1752143AbcGRQo3 (ORCPT + 29 others); Mon, 18 Jul 2016 12:44:29 -0400 Received: from mail-it0-f46.google.com ([209.85.214.46]:37467 "EHLO mail-it0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752027AbcGRQoB (ORCPT ); Mon, 18 Jul 2016 12:44:01 -0400 Received: by mail-it0-f46.google.com with SMTP id f6so79303251ith.0 for ; Mon, 18 Jul 2016 09:44:00 -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=gDC+CAqYZVXaRVDPzrkQxY88hbiNbvbbmujXq8S42/o=; b=EslnKF6xjTOmpc8wFWJ5AvybdjXuL7Q+/cEEMYyrUj3CwvCRRkOpj5SagoFXX2p/ID XdVtkt5wFpknMXpXEgCk7pvsyzaFpU0A9LxjwL8GzDuJaLvLIA2EcGhVV97GBrE/fdoX lSKZtS0opjj/X+irG0PRfUlAptrjhwbyUxi3E= 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=gDC+CAqYZVXaRVDPzrkQxY88hbiNbvbbmujXq8S42/o=; b=QP8CO3Tb0lXemaCv5+QdZA462ilpbDCS8PBdCNgvnihCOcaAwwzNAhEKot22INLQt+ B+YvanvpOqulko+Wxa7W+UDwikBj8fihQll8+KfS2FoDBbSJLGTYsbst+bS8CtIlFp3v apkLMmlVAm0hL29hpO8XX/yQdWxbf/HPMWCbpEtV+SqTl0XX3hxxU3p8OaIFwB5dSG/p RpMeB073Hj1WieKpyCWpsn3jZPX2pZZK3mVzDHUn2L0DXHERgWdtVi/mScnodSXxild4 WDbeuEPGcP3BNLO9aZIl60LswO5zrxkH5B04NadWUSFvL7bxZcUHrQq4mifa22QCpAfm dDAw== X-Gm-Message-State: ALyK8tIXlKITwz4qpssFgwtqylrgVVVHzRzWjQ3+RGKw3yTyVB8MVec5hqOWLH/IbEnYrVEN X-Received: by 10.36.55.2 with SMTP id r2mr49621433itr.73.1468860233226; Mon, 18 Jul 2016 09:43:53 -0700 (PDT) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id 6sm9195332iov.34.2016.07.18.09.43.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 Jul 2016 09:43:52 -0700 (PDT) From: Mathieu Poirier To: alexander.shishkin@linux.intel.com Cc: peterz@infradead.org, mingo@redhat.com, linux-kernel@vger.kernel.org, Mathieu Poirier Subject: [PATCH V2 1/3] perf/core: Fixing filename for start/stop filters Date: Mon, 18 Jul 2016 10:43:05 -0600 Message-Id: <1468860187-318-2-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1468860187-318-1-git-send-email-mathieu.poirier@linaro.org> References: <1468860187-318-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 --- 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 912f10dfbfe5..a8371814dbf4 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -7852,8 +7852,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;