Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1822124pxb; Mon, 8 Mar 2021 07:13:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJyRbDmN/b7TtxbLF+fPltjUWvPBxskSNu3P1wgUq5rFTmN7KIx+be9hfyWXU7xjETjRb+yR X-Received: by 2002:a50:da8b:: with SMTP id q11mr23121679edj.352.1615216410363; Mon, 08 Mar 2021 07:13:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615216410; cv=none; d=google.com; s=arc-20160816; b=Gcuk9iIPrkj6l7/IP1aHjAUibC7Rf6k4PCJI8+qP9y5sB4in/9gOyBFlakzwWX7lOT nG1HEDUbLuWbXWbf+Fok8Hvqm75y5M3iYy7U+OB/gPXxK84M8vfFRDaJXGnpsOALdcaT TQvO4sL53zco1es1pkKGQ4eZ70WSsdPsVZ0XH2MDdiTatHyjvhmJgXx60KLCKbwg3XaE CgU3mFcz5t6vQPAEaKs2FPEwF1AXIPfIowupCwt81/CTUH6ReOZ48apPVRKJY1eOvQZV vYYsJgn8jAir3UQ2l9uEbfVX3of4RJiTBLRpc9wkYNKugTqotGdHDQUByx2hU2Fy0ssF fK2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=wJu6NQNitlM/x2a0Rk0ylPcQJFuojZt3Px95wP0EkFw=; b=sa63/MhYtgEiS73ywpSoWOeHQHylvZgxLWOGHoVuBp+dPaZ1z6Due4p7rpi+7cJTbW wlG0Oqw5pkAiKRFcuk15u5oRMbb/d+yNeEMWy0eTqSqucwfUMyQRSxYfyw9oIrFI/ftC kYzj9hvR7/wIfw9E0sT2QPK/ICHilRVwOkDYluZ89rThdy0StSQ6zgtnV30CAOLquy9y kQEkr0x36P6n/L67092V70Dp3mFdlQuaGAkhsR/E7Kw0+hT6bDEvJG7QwlJIBH93cWB4 H2YEEK7dUg94lrOsni3pwWL1UBswStfhLSrEuu3A1KlAo30R3F3vqWDB6+b1P7XtUMQw r7bw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z22si7340151edb.163.2021.03.08.07.13.05; Mon, 08 Mar 2021 07:13:30 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231395AbhCHPL7 (ORCPT + 99 others); Mon, 8 Mar 2021 10:11:59 -0500 Received: from mga05.intel.com ([192.55.52.43]:26407 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230521AbhCHPLf (ORCPT ); Mon, 8 Mar 2021 10:11:35 -0500 IronPort-SDR: I35U27lFURleWkfyHZmySk3NwU577IBIIGMMUdrb8/QUS85N79lg2vaajy11hwEMV7gDhKGFA3 ulm3FxZiVu+Q== X-IronPort-AV: E=McAfee;i="6000,8403,9917"; a="273073017" X-IronPort-AV: E=Sophos;i="5.81,232,1610438400"; d="scan'208";a="273073017" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Mar 2021 07:11:35 -0800 IronPort-SDR: sYJSPz+rye/HLbNQ5eN4qbQTQtDCAutmt0Uy74IRbYgS6SxlMTHvPSgoRLjO7IPEdfRA1I9Ash bZ+3MTPGpp2Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,232,1610438400"; d="scan'208";a="602179477" Received: from ahunter-desktop.fi.intel.com ([10.237.72.76]) by fmsmga005.fm.intel.com with ESMTP; 08 Mar 2021 07:11:33 -0800 From: Adrian Hunter To: Arnaldo Carvalho de Melo , Jiri Olsa , Andi Kleen Cc: linux-kernel@vger.kernel.org Subject: [PATCH] perf auxtrace: Fix auxtrace queue conflict Date: Mon, 8 Mar 2021 17:11:43 +0200 Message-Id: <20210308151143.18338-1-adrian.hunter@intel.com> X-Mailer: git-send-email 2.17.1 Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Reported-by: Andi Kleen Fixes: e502789302a6 ("perf auxtrace: Add helpers for queuing AUX area tracing data") Signed-off-by: Adrian Hunter --- 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 953f4afacd3b..5b6ccb90b397 100644 --- a/tools/perf/util/auxtrace.c +++ b/tools/perf/util/auxtrace.c @@ -298,10 +298,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.17.1