Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3427659pxf; Mon, 29 Mar 2021 01:48:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7A86tbEO5hypCWrgmbIqf7ZjX3uf0cZaq5WLALfSRT6d9m6AYbTuq8ijZpCFBIX5URpOp X-Received: by 2002:aa7:db4f:: with SMTP id n15mr27224584edt.12.1617007711372; Mon, 29 Mar 2021 01:48:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617007711; cv=none; d=google.com; s=arc-20160816; b=Icnbyxd+qheo3n3TNDICx22E/FneBZlXI0acgJ/s3pNt8OU1acEIV4PjmeAfIb38Ri eRBJcXh8esemTqxieNnHT/p/CvxlqzlNo0CGrFVu1HAix7/IoPjs61aCRCrJEIbt2j7S 0J3A36dUqsblLo3Io4dK7awi8pfz9hC6Zze2iu6K829ImRlbgB33g4ApOui33vHDZZB1 H0oSXYJLsphArwNXy4D4IT3mtr42KDpyAH9HpN0Lrg1CiBnjcSR+bffuUjZIoUoBN3u2 oXWA3jXGRU4DDaybIE5eQ4XMhhWlGvwSa1maypzT0B0u/wzvYuezSG6Qg1Pv05WaLg4w ny6Q== 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=Sg7+zzR7gXW0jDhtukR4a9N1aoLsl/xFXdjPb03bcEY=; b=xCqLAnSXY4EVmJb0qBgElVRo9nD2PbtSQCFA29d7QT2dIzhfF5QAlKVZyd7OzEM6Vo qsfsZVb5BJxD516OE3A4qo20OZRCl3GPYSiTcMH1cJ8Kr2aS1MpClVnsKC174MANXiNi 34u69SFjDL21/qj8ogaFGcmElYMKQdbQB+CDi4Rtu1YTc3yTevJrJ0Z2PPO13jtIaxih BLKUx2yd3ZG/XMmrGl9Y+2hwEOWiPe4UAaLpm9pe/Ulapxh8oWAoyEH9pcaJnkDngWCP FOCv/rfZs1sBXKtVGmnlX7Pv0GAKW7Xjm0PJoYH+VQID5cIw+/SDo3f+izxGnGTERw0t 9LQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="V/nztIaF"; 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 ay3si12794513edb.106.2021.03.29.01.48.08; Mon, 29 Mar 2021 01:48:31 -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="V/nztIaF"; 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 S235076AbhC2Inx (ORCPT + 99 others); Mon, 29 Mar 2021 04:43:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:42578 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233178AbhC2IZz (ORCPT ); Mon, 29 Mar 2021 04:25:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5E1E7619CB; Mon, 29 Mar 2021 08:25:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617006320; bh=iDy0QarVjMwLqY/B2SxYpXmyhbxazrFMkU3lM6u9kDA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V/nztIaFOHi/lKLrD8SmvNGb5z6NE72RZlOpv/qxwWUvj/GkfrTFoyVbdoSerbxUl 6zCX+ULak7ECGI5mHbEeUN9c4u1nPZmYLTD8DX74PaqoYIr4nNTouBIq/zMsvRRuAM /T/KglkeldiGF87yJcuPm2BxzL3Wu/aq46Yo+QLM= 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 5.10 198/221] perf auxtrace: Fix auxtrace queue conflict Date: Mon, 29 Mar 2021 09:58:49 +0200 Message-Id: <20210329075635.733341214@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210329075629.172032742@linuxfoundation.org> References: <20210329075629.172032742@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 42a85c86421d..d8ada6a3c555 100644 --- a/tools/perf/util/auxtrace.c +++ b/tools/perf/util/auxtrace.c @@ -300,10 +300,6 @@ static int auxtrace_queues__queue_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