Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3410291pxf; Mon, 29 Mar 2021 01:11:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxaS6SBNXcJfdVXtwtxZZQW7hdJFm+BWFlmT3nCT3eRRUuGqjfhO1lin3IrlXAoqQCoqi6E X-Received: by 2002:a05:6402:1d39:: with SMTP id dh25mr28111199edb.282.1617005501128; Mon, 29 Mar 2021 01:11:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617005501; cv=none; d=google.com; s=arc-20160816; b=M3eWIN2h6iJwTsh/92GJQZzXLNSLPjyARMXOJYE0h+BNs8VcOjPBnQ8+wQ/AQZyBAv vcWZNNWAOVl0t+u4amRaVeeI6W6I71o1lJKjVDyIwXaFup/3p1EtMj7fUyIp5zmU/d8O KfRdercz4aoEi39VvO0jJ/+2cd6tWLo6lv0cQWpkYrH5f+gMlf5I2UMd5gsHh6+9t5Gm grkd9FXfDVkEPKUfG80i8FhBZwbgy5Hjbk42T3NYNuatebVLdpJIJph7XqjjoMJdjxuC bi047JEzeSXGUuoaiYNp0hT/qGjdsykDXScct2CF6EnTQwObwlFass4xODL494DUTHJD 9v3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4GNB++mAIQ728DF3fdELL0vMGJx2eUl2xbCA612w8gU=; b=m6itwqeDszwZLl7cdb/zoBFY5jk9lDUUlFW421KH2XQ2FOI3g5QL7jo6RDgPUaso1B 3dNdlq4Px9ShGxd48Wlq12Juumy/Oqh+Z3GB7MEixewn1PBht6IefofgH6vV33J4BZ7G cTCwMvYMnrEseOsEw81vDqYVNdTUDea/2hDMKlAt+ydg/Gyz1ibLhF0t3BVt9L3HmIYv vOSdMiURqRwHYlioVGlxW+FYAvfnOje27ogCrcO2NcxfFGmBr/9M24LGgt/NGVbCGUTJ V1emcOImdBHo8rzFBeNghdieebSWvSJ+eY+DzzEpvYhNGGtHgwvfhOGVmyTkokBV+Rrq hYUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xLmt0PFM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i13si12456269ejy.93.2021.03.29.01.11.18; Mon, 29 Mar 2021 01:11:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xLmt0PFM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232640AbhC2IKU (ORCPT + 99 others); Mon, 29 Mar 2021 04:10:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:49412 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232184AbhC2IGM (ORCPT ); Mon, 29 Mar 2021 04:06:12 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2C7206196B; Mon, 29 Mar 2021 08:06:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617005170; bh=bioptFnmAdZ/zCalDIFArsnAR4pVdV4g21+yHhqX0PI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xLmt0PFM9DYSMN+JFDuuKcGxvbGGfyZJZKjEj+9KXHH88PTwIr+kXugYKerODpkBB /69sb/WtM3xnkjHPAb9bevM23uh4B2oQjDmOwlDyB/nlNGVIkimd6mptnQUl1cZ/Lr HFUP3ZpnRnXkNCXz0W+6dg6VWLx36uoRFPcaDzaU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andi Kleen , Adrian Hunter , Jiri Olsa , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 4.14 50/59] perf auxtrace: Fix auxtrace queue conflict Date: Mon, 29 Mar 2021 09:58:30 +0200 Message-Id: <20210329075610.523221477@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210329075608.898173317@linuxfoundation.org> References: <20210329075608.898173317@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Adrian Hunter [ Upstream commit b410ed2a8572d41c68bd9208555610e4b07d0703 ] The only requirement of an auxtrace queue is that the buffers are in time order. That is achieved by making separate queues for separate perf buffer or AUX area buffer mmaps. That generally means a separate queue per cpu for per-cpu contexts, and a separate queue per thread for per-task contexts. When buffers are added to a queue, perf checks that the buffer cpu and thread id (tid) match the queue cpu and thread id. However, generally, that need not be true, and perf will queue buffers correctly anyway, so the check is not needed. In addition, the check gets erroneously hit when using sample mode to trace multiple threads. Consequently, fix that case by removing the check. Fixes: e502789302a6 ("perf auxtrace: Add helpers for queuing AUX area tracing data") Reported-by: Andi Kleen Signed-off-by: Adrian Hunter Reviewed-by: Andi Kleen Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20210308151143.18338-1-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/util/auxtrace.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c index 44c8bcefe224..0224fc3aacc1 100644 --- a/tools/perf/util/auxtrace.c +++ b/tools/perf/util/auxtrace.c @@ -250,10 +250,6 @@ static int auxtrace_queues__add_buffer(struct auxtrace_queues *queues, queue->set = true; queue->tid = buffer->tid; queue->cpu = buffer->cpu; - } else if (buffer->cpu != queue->cpu || buffer->tid != queue->tid) { - pr_err("auxtrace queue conflict: cpu %d, tid %d vs cpu %d, tid %d\n", - queue->cpu, queue->tid, buffer->cpu, buffer->tid); - return -EINVAL; } buffer->buffer_nr = queues->next_buffer_nr++; -- 2.30.1