Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3417285pxf; Mon, 29 Mar 2021 01:26:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+YG2/gE8ar8TCtXbd1DzG7GmlKMcmXH7Ac9u/ed9Hi5KWDlNe/6eOtSfBQKJmzYriAw79 X-Received: by 2002:a17:906:c08f:: with SMTP id f15mr27417014ejz.318.1617006364210; Mon, 29 Mar 2021 01:26:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617006364; cv=none; d=google.com; s=arc-20160816; b=AxqyCUTFpcnYhpHNSa1yOHWbzCWYI7dLRTEGfhxjOWYuuselYTpRL1LKE84C52oOZh c6z6GoKALn3xz71dVjxn42iNuecA6xp0BP87/3Um6fwSXtirQIdEp7Y+1dl5+G0Vy3JO WjM5T8/Us0J2mHGmJ6YwHyBA8+7dorq/ABMHbbkOrFuFV1ZQVkOtN3BRDHlo50zaE/Rp dyXIORi9Okhq81+wdVpXnIDUy0dGdhBFIXnaGtL7QdCxIkAVUpWbTGUVaanoYJgQBn94 OnnbbPpWTfprawYWDk1dgi1lANPu7K71KdjQ6lDjT5RRe8oPb9WAfIkOS7QuEqYGFkxI 1Z/A== 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=G4FI71MbcENvCQqiOB6gD1Asi4VeF7VI1F2MxzpPKY4=; b=RSfsTV0q1zZaKzL621g5KS1jsCED1rM9DncehMfusI7wnOhBOgmukbPqsufro7N+7o LTTLEb29ud0wTMPD4BhqVf4C251hOByCb8Y7DztKWpLiOEHi3XQCbqVbncxvwcetHENV usTh2UADp3lBCp+NrfiF/Bf6kKAZGDx1QSoYkAR5zvP+ZQIadtJ9hWDlg9sius7wLUXU 2NX6SX8+tHTyHE+aVt3022Qr6hvqSOSJyYcvYckKY+mZQi0RYq7Lwve0Ge34bBVFqORd oIX0mbSznzMASYsSNp0iBGDr9rCJUBGx3yneQGpmehTLyiYvegzZLtUv6LXsLom5+qvd CbkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=u5zITM0W; 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 gv29si12086685ejc.61.2021.03.29.01.25.41; Mon, 29 Mar 2021 01:26:04 -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=u5zITM0W; 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 S232535AbhC2IYq (ORCPT + 99 others); Mon, 29 Mar 2021 04:24:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:59002 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232469AbhC2IQD (ORCPT ); Mon, 29 Mar 2021 04:16:03 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 32C9B619B5; Mon, 29 Mar 2021 08:15:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617005740; bh=qpMLqGHfA7M4klqsZuSpMwySmlEQI2tjlHzgGxINJ8E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u5zITM0W4I726un2BbWIgkIAOWn7xxE9dswi7LkfhXWwV+YfJt2qSa2LIlS0sMr3r 6uNwQsilIFVVzPc0WckkUUabSoeiWkOfzTIlUfK4WGtJaMDI9VumSYH+2nhB9Qyjir iOhcGckv+/gtMl1vuvfoAMfi9dwTqKqo7mIxyCRM= 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.4 099/111] perf auxtrace: Fix auxtrace queue conflict Date: Mon, 29 Mar 2021 09:58:47 +0200 Message-Id: <20210329075618.511658311@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210329075615.186199980@linuxfoundation.org> References: <20210329075615.186199980@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 8470dfe9fe97..61b8dc45428f 100644 --- a/tools/perf/util/auxtrace.c +++ b/tools/perf/util/auxtrace.c @@ -252,10 +252,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