Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3413772pxf; Mon, 29 Mar 2021 01:18:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyU0T8fZlK70AuKpFzqAQaiCBfXbD/gGF6fkJSPsCEEjBXPHdmWsbidVBEGYW6EBkvAXkW/ X-Received: by 2002:a50:e80c:: with SMTP id e12mr27584833edn.229.1617005918595; Mon, 29 Mar 2021 01:18:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617005918; cv=none; d=google.com; s=arc-20160816; b=PJjXfQ5LCdQsdFlwqGLEcCBSeleB8Ds+XzvzgROMuqvNDr6eLUtOWOTm9RcoPF78cr WatuuFqVHEBW/CjcrsFEEWesnjdyBshedR5AYndd42wmkcvBm0s4jr1HSMFLtFcDj31P nZ3qGLq9LgPlXaGI3kA64/S7PUklbbqabOivZLe1eamCtQW0PSxwkDFD52jmVjaTZlJS /bCBv+qD0wpmw3b/bzwgiKUQ/fP4HooMrQ7jJkdS6KgCUKhY8fsLYiLquBgmrggzRwRg orDy4kpcTQAHIJo8n+WQSg8fUtkpKjuRjJ2kabzElcKtbD5ZcF0lbafNeBA/00TmEwMZ FjWg== 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=GYB5/8dZ7NEkmMEuTBJdS6muLXoZAuwQv4nUu+hTKoY=; b=xNbmpAW42rN+XPpoaYYegF4NW5hJPGgWGcq5RPlV/BrDzHXsPH768SJVTZQfI+0nEz 83CDj6/mXDjaMgvcdj0nzbrqEDbIvrduqmqN8SIOCaUyKBSJ6kitObTPYUdvGVZ2HVo+ SwkeCfimQdkZ2s1qaM9F7KynFBjzII2ZRIpjc0Dgo/dVCeoOOCI4J/EzpL3WgG44U3n0 IPVbp/y9fXFG6fUNyDl+R+UKRwoAQD3WC4soqlhE6c3G9N6AMzXa1F9s4x0P+SVYkVto TplFolRRORKPUqmWcNZaq7XpwGeeM6p8Oyt4Qi166XewOc9TlU2fmfwZw2UfMCzJssYs gODQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=t1SaOnqs; 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 co21si12590261edb.513.2021.03.29.01.18.15; Mon, 29 Mar 2021 01:18:38 -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=t1SaOnqs; 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 S233077AbhC2IPv (ORCPT + 99 others); Mon, 29 Mar 2021 04:15:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:53540 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231676AbhC2IJr (ORCPT ); Mon, 29 Mar 2021 04:09:47 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EFA536197C; Mon, 29 Mar 2021 08:09:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617005386; bh=uEH3XozcX1cvevLZRcPN/Upho8z/wt3I9uLXB2xUDDM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t1SaOnqsz2SWOY6NPcgtO4TBRsNQF3fGmpCSibSA5ULmp/8PjX73yWqnLXLsKwqW+ WXo9Kf0SECvioALtFV5MVHCvCXLbWmQK09Me1e5oo4r4wOuDnOvEiYEHdzfDcifdmE pXVx6WEiZ1W0iKOt2/IgzzOC2yU04kaXi/8EhPpM= 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.19 62/72] perf auxtrace: Fix auxtrace queue conflict Date: Mon, 29 Mar 2021 09:58:38 +0200 Message-Id: <20210329075612.329953483@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210329075610.300795746@linuxfoundation.org> References: <20210329075610.300795746@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 40c93d8158b5..f7c4dcb9d582 100644 --- a/tools/perf/util/auxtrace.c +++ b/tools/perf/util/auxtrace.c @@ -256,10 +256,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