Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4797425pxu; Wed, 21 Oct 2020 05:46:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwI6FOEglnnK5Uwas6ij+cEktZ+DGyUuAEI7FHSguLsODkVvBRJaDRBcV4DHJoKtsY3/WfI X-Received: by 2002:a17:906:5052:: with SMTP id e18mr3186945ejk.530.1603284402746; Wed, 21 Oct 2020 05:46:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603284402; cv=none; d=google.com; s=arc-20160816; b=sBa5YK97XhfeyYyIYT2XB1AE1zUkja7xMv7kqpcSyWcRGDNdEuprCnlL5pvcPbn+vz eIqXfbUSUqPM/ASWlkyQjmr/D+z3Sy8pvf9216gZMpkqQZFelHUBKIko/rkHIDxN6mme diVgsjQ/983YZd2T6ZnoEV3W4N4s24BqZx6z7Pfs9sL9DmlrVbx/KpD71/j7T+GTCTS6 wQSE/EWZ0EEVV5aL4kxBVMa5itsCn0tEf0G+swza9U/7jTjTSJoBCI22FPQOfp0Y2Ty1 wLqOiSPuvvsHKyxCA0zOykiI/j54zoutkkEqNXl/WA51s1/JHcmJAnjh1cVqW5OnI3Rz YbFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=jVONTDolj4MDBS/GViWgsApTFkBxojD1bi5r7Oc5t8Y=; b=EdA45UM8f+9ELA7HgDRdquOYOSUhs/DS9njgoa8psvX67SlKHw8hq3VLMAkpLpQ2Tf sWT8M6RRVZLBTJsJSsINOiWJxiVIoZaK1JPNx967tQYJLrG4MMolMj3+gzkHfErkyp+u CcGGg4eEifQmUQpYN84202vPTNYY0ptALeR7GNfKrCmKao2s1PDNwJMDlemzz9bLB+Hp Z+Qm+i7wQ749MZWVsKSD8+r7vwIPmN6xIs3ClAQflu+owJM+m888RFuFyBPmODAX+4wc GeWgCBjkqn459Z98QsgFB9vIO4YqhLCY0bsAZAx/9Y8w2GrnHhCmn62YfYshDrz5PFNG sVNQ== 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z24si1291948edl.8.2020.10.21.05.46.20; Wed, 21 Oct 2020 05:46:42 -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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2501899AbgJUHfI (ORCPT + 99 others); Wed, 21 Oct 2020 03:35:08 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:34903 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2441006AbgJUHfI (ORCPT ); Wed, 21 Oct 2020 03:35:08 -0400 Received: by mail-wr1-f65.google.com with SMTP id n15so1854749wrq.2 for ; Wed, 21 Oct 2020 00:35:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jVONTDolj4MDBS/GViWgsApTFkBxojD1bi5r7Oc5t8Y=; b=Wpq730NME9B1iMn+lLn2d8GqCstjIUb+lxLJGyqKiXe8dDqbZo3IMpcy/UZrri2RBl WuSlcURqGiWM0br51Hv/7yEC7JbAqBdi6dCthroZag8j6FGtA0du3DUnGJlZlbyJrgOZ 8h4XemSHWwegYdvIuEPoPELIUzxWgDEa5A/QuBVZRx4+L+0iGylNgacNmQd/njUvxyTn TVaic02LIX8X0T6q7vMHFPqaAQyRl3eH+U2lJkpwpgtBJU+ZOXj/4S9IwhCjlBIG/28X niT/Uv/lAinb5C1gbjv224FajjunDeOPVae/meVorMCDnSk0Qp5tJ1NMzg/FVMYAq1pk pPWw== X-Gm-Message-State: AOAM532QuAjNiPjpU6fv8R4e33BdCKD0lN8b8OErOU7TbZP3QwjA9qE/ 0bbMjvyauasd8AWSXt/+ZmJ558HcgQNOx43a7Vk= X-Received: by 2002:adf:bb43:: with SMTP id x3mr2994127wrg.250.1603265707061; Wed, 21 Oct 2020 00:35:07 -0700 (PDT) MIME-Version: 1.0 References: <810f3a69-0004-9dff-a911-b7ff97220ae0@linux.intel.com> <0652b8dd-e753-7c10-27e9-af9524e7ccc5@linux.intel.com> <81ffefab-ac4e-c51c-809a-b9ba96d6d867@linux.intel.com> In-Reply-To: <81ffefab-ac4e-c51c-809a-b9ba96d6d867@linux.intel.com> From: Namhyung Kim Date: Wed, 21 Oct 2020 16:34:55 +0900 Message-ID: Subject: Re: [PATCH v1 08/15] perf record: write trace data into mmap trace files To: Alexey Budankov Cc: Arnaldo Carvalho de Melo , Jiri Olsa , Alexander Shishkin , Andi Kleen , Adrian Hunter , Peter Zijlstra , Ingo Molnar , linux-kernel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 14, 2020 at 9:09 PM Alexey Budankov wrote: > > Hi, > > On 14.10.2020 13:52, Namhyung Kim wrote: > > Hi, > > > > On Mon, Oct 12, 2020 at 6:01 PM Alexey Budankov > > wrote: > >> > >> > >> Write trace data into per mmap trace files located > >> at data directory. Streaming thread adjusts its affinity > >> according to mask of the buffer being processed. > >> > >> Signed-off-by: Alexey Budankov > >> --- > > [SNIP] > >> @@ -1184,8 +1203,12 @@ static int record__mmap_read_evlist(struct record *rec, struct evlist *evlist, > >> /* > >> * Mark the round finished in case we wrote > >> * at least one event. > >> + * > >> + * No need for round events in directory mode, > >> + * because per-cpu maps and files have data > >> + * sorted by kernel. > >> */ > >> - if (bytes_written != rec->bytes_written) > >> + if (!record__threads_enabled(rec) && bytes_written != rec->bytes_written) > >> rc = record__write(rec, NULL, &finished_round_event, sizeof(finished_round_event)); > > > > This means it needs to keep all events in the ordered events queue > > when perf report processes the data, right? > > Looks so. Maybe it's not related to this directly. But we need to think about how to make perf report faster and more efficient as well. In my previous attempt, I separated samples from other events to be in different mmaps so they were saved to different files (or in a separate part of the data file). And perf report processes the meta events (FORK/MMAP/...) first to construct the system image and then processes samples with multi-threads. Once it has the image, it could bypass the ordered events queue entirely. Thanks Namhyung