From patchwork Thu Aug 11 19:47:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 73816 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp275441qga; Thu, 11 Aug 2016 12:47:41 -0700 (PDT) X-Received: by 10.98.22.212 with SMTP id 203mr20267650pfw.74.1470944861194; Thu, 11 Aug 2016 12:47:41 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e184si4607202pfa.193.2016.08.11.12.47.38; Thu, 11 Aug 2016 12:47:41 -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 S932353AbcHKTrd (ORCPT + 27 others); Thu, 11 Aug 2016 15:47:33 -0400 Received: from mail-it0-f51.google.com ([209.85.214.51]:37249 "EHLO mail-it0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932265AbcHKTra (ORCPT ); Thu, 11 Aug 2016 15:47:30 -0400 Received: by mail-it0-f51.google.com with SMTP id f6so6216753ith.0 for ; Thu, 11 Aug 2016 12:47:29 -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=T/p/q+6mpgqup5+xWha4hGcwvcP/8ao2FOyXLbNqm3g=; b=X8Hklt5UUpErFUOeXg0GKoAwrA+aup7WGO5bihNB0RC/UE9Y6GBxdNNRCXYuYSL7FO sncWAn7z4z5CLtVhuv4/VvW52NifGJcSrzfVbLr0G01PH7GNhM99bo7Z0qJc939dIdgA LbWX3sTpGEJBeDEvl8o3cr1Fqfhy2SUN9bzkk= 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=T/p/q+6mpgqup5+xWha4hGcwvcP/8ao2FOyXLbNqm3g=; b=PTvhbwX/4jCp242O5/QRc3Va2TkXoy3cgYTDlBMQTgPiCmEmnA3lW/Hvt6wUHJFOok vcJEpC/MJkW4ia1Df8PhkD8EdpzbbMclqyo5dEQVBnN1lMCJxskoDUIQsSYKK3Vlt32l 3xEEv769AMV+1jKlCBdVS0WeGIbaQgRk0lwzs6ziFbx/c1gZvJuY8TR9M/NoO1vftHQE spa8ZAmO4jLAZP7qv5yT/hQPkgl4J02IOUN+lecli2WK4wRXWIkJ7r1CBaY54I7ZULyF Cr8/Ia92gJPLwyXj5OUoPjqz9it6l1IQlO1J49O4VWONRGDwYS94qea7PwYSkljejRyr xk8g== X-Gm-Message-State: AEkoousFvrQYqS7NDt1Q2VO/zW3uyiV0hN2lua6u6XHlAjijrD1ErviGOj5/c/wYzD5M69HR X-Received: by 10.36.2.137 with SMTP id 131mr11961755itu.30.1470944848473; Thu, 11 Aug 2016 12:47:28 -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.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 11 Aug 2016 12:47:27 -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 3/3] perf/core: Enabling mapping of the stop filters Date: Thu, 11 Aug 2016 13:47:23 -0600 Message-Id: <1470944843-7575-4-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 At this time function perf_addr_filter_needs_mmap() will _not_ return true on a user space 'stop' filter. But stop filters needs exactly the same kind of mapping that range and start filters get. Signed-off-by: Mathieu Poirier Acked-by: Alexander Shishkin --- kernel/events/core.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) -- 2.7.4 diff --git a/kernel/events/core.c b/kernel/events/core.c index 463235ffc39c..b5022836649a 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -6553,15 +6553,6 @@ got_name: } /* - * Whether this @filter depends on a dynamic object which is not loaded - * yet or its load addresses are not known. - */ -static bool perf_addr_filter_needs_mmap(struct perf_addr_filter *filter) -{ - return filter->filter && filter->inode; -} - -/* * Check whether inode and address range match filter criteria. */ static bool perf_addr_filter_match(struct perf_addr_filter *filter, @@ -7781,7 +7772,11 @@ static void perf_event_addr_filters_apply(struct perf_event *event) list_for_each_entry(filter, &ifh->list, entry) { event->addr_filters_offs[count] = 0; - if (perf_addr_filter_needs_mmap(filter)) + /* + * Adjust base offset if the filter is associated to a binary + * that needs to be mapped. + */ + if (filter->inode) event->addr_filters_offs[count] = perf_addr_filter_apply(filter, mm);