Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1287711pxb; Sun, 12 Sep 2021 14:03:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIiIb8tZa/gT6a8+9hQtWNjIhQZdoLJSQje67TZXgeJGYFzKMUQxJEN1pH+0QorlmTYWVB X-Received: by 2002:a92:de0e:: with SMTP id x14mr1297008ilm.259.1631480628005; Sun, 12 Sep 2021 14:03:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631480627; cv=none; d=google.com; s=arc-20160816; b=Q8L6Z/hbN86iwiJBMI0kMPfkxJb8+Ppv2gR+o8ymSSRjqYwx2LIvnMzsF6Mcm/fLni Ljn0vGRR8J9Qu7XG0JcyUGvBicur6J9Hzm2aaiu68EzQhme9RkFB3t/mJFd5ldVRcFVF MbIFsCK6fNn+ZDllsjsZjdeboYOLqPM1B8KKRqJh1R95uSUdQbN09qoGk3/K92HhNlKu dM4qCGWh5ycGNbJ+GFtiIoGIKh9G+tM7cZMyMR77IU+RDWetOFlR1NFMhqZwzw0LDYXA TqPsgB//PcZT85zPvFF9Unj5Svs6j/kMwHYSTYBWCyQ3HfUoaMhpk7pXXLmNQwJ79OI6 qwNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=S0iYLo77hJk72w6pfp2mY/JIQveupjfC8WzUeJ2OWHk=; b=bv8XznnY5eT+olDqB/hIMD1eGwTzhNciXAqHYi6c5vZCEm3SkS8+sWt/yHX7bEHpKE fZxGAFNHkx29t/lhsfMdJZsiXDQhwrENRfe9vzSr54Z97dw1C4U6QnTfS4pDcpRGGHKh c0RYbxuFANQjjDlw3Z+ixCoOeIs0XWqXuOEos/wQk+qJe5NQ6nOTgfVDT+fBbyxoM4eU eiy4s++IfwQ9Ztyeu9zpHhKggrAC297u+EaL9FFXfy5nN/Zr/Cwu82vVkoV8XLXHmQZu xVP9/10+6pr9YKInPkDzpkjf3f2VeGLnO2yEWCV/22/XZjiVAjQY5K+hDAjm2/T2WHh1 UkjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OplcP2Gn; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s1si5424946jaj.97.2021.09.12.14.03.36; Sun, 12 Sep 2021 14:03:47 -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=@redhat.com header.s=mimecast20190719 header.b=OplcP2Gn; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235349AbhILVDV (ORCPT + 99 others); Sun, 12 Sep 2021 17:03:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:43843 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229930AbhILVDU (ORCPT ); Sun, 12 Sep 2021 17:03:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631480525; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=S0iYLo77hJk72w6pfp2mY/JIQveupjfC8WzUeJ2OWHk=; b=OplcP2GnL6+XV8eoB8EfookCBKjTDcAFxPE2JTVIAiLoZAWiXXncZzfoipxAFgSMcYdwHf 2o+3YfDyPp896TBq4eLquCEn6APMrTzY6nvY1GkxDG3YrjJpVDe89qldvgDz2oOPT5ubUw cHSdhtjlfDNmfo30fmVPhC/8fpK753k= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-446-8SxSmV6LPOuGaLf_dOwqAw-1; Sun, 12 Sep 2021 17:02:04 -0400 X-MC-Unique: 8SxSmV6LPOuGaLf_dOwqAw-1 Received: by mail-ed1-f69.google.com with SMTP id y17-20020a50e611000000b003d051004603so3195049edm.8 for ; Sun, 12 Sep 2021 14:02:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=S0iYLo77hJk72w6pfp2mY/JIQveupjfC8WzUeJ2OWHk=; b=wk7D/11fpgUgY/aTdoWU+JEe9gvAS4Gg4w6nLOBirA0tmTJwfNVcN20UAZC5cnwGaW JtAceo+Qvp4r4RXl+isBQHHjwtOyr/ClD3m9NjDU01VgY1o85nGARiCThe488wD/lVxB qvElihCnqXiwECtJbYhY4Yf979iOieD1LOhLRnJQOjPrD7kzWSnLmF4sI9SQtalW59vS N8QuUzg0iMoVN56kifShzwrgbdnH6UDHfE/hMdSf1CInOuzX2h+4XmgFu3EPw4YDo56c 1o4hJZNsMN9m2zQFLn8tsS+rwQUSxWVmOpfQw5UN5C4ORXFbiUe0lPyavCyayryFT7VI tECg== X-Gm-Message-State: AOAM530LzmE9YZvcx0Hppz0gn6LqoxgWjmbbLw2d8KRDkkt4E9goVtKh 3SY1zfoYI9n7lmtOj6ZdHUeIa+7lFQV6bJZAu0AoajTfhf1cbxTV1FcrOu0Zpl6EI/OxN1El+7j ca+z/om+xxgwf/WP99Pa2uR0W X-Received: by 2002:a17:906:7c52:: with SMTP id g18mr9231035ejp.246.1631480522412; Sun, 12 Sep 2021 14:02:02 -0700 (PDT) X-Received: by 2002:a17:906:7c52:: with SMTP id g18mr9231019ejp.246.1631480522255; Sun, 12 Sep 2021 14:02:02 -0700 (PDT) Received: from krava ([83.240.60.52]) by smtp.gmail.com with ESMTPSA id l16sm2477236eje.67.2021.09.12.14.02.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Sep 2021 14:02:01 -0700 (PDT) Date: Sun, 12 Sep 2021 23:01:59 +0200 From: Jiri Olsa To: Alexey Bayduraev Cc: Arnaldo Carvalho de Melo , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Ingo Molnar , linux-kernel , Andi Kleen , Adrian Hunter , Alexander Antonov , Alexei Budankov , Riccardo Mancini Subject: Re: [PATCH v11 13/24] perf record: Extend --threads command line option Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 17, 2021 at 11:23:16AM +0300, Alexey Bayduraev wrote: > Extend --threads option in perf record command line interface. > The option can have a value in the form of masks that specify > cpus to be monitored with data streaming threads and its layout > in system topology. The masks can be filtered using cpu mask > provided via -C option. > > The specification value can be user defined list of masks. Masks > separated by colon define cpus to be monitored by one thread and > affinity mask of that thread is separated by slash. For example: > /:/ > specifies parallel threads layout that consists of two threads > with corresponding assigned cpus to be monitored. > > The specification value can be a string e.g. "cpu", "core" or > "socket" meaning creation of data streaming thread for every > cpu or core or socket to monitor distinct cpus or cpus grouped > by core or socket. > > The option provided with no or empty value defaults to per-cpu > parallel threads layout creating data streaming thread for every > cpu being monitored. > > Document --threads option syntax and parallel data streaming modes > in Documentation/perf-record.txt. > > Feature design and implementation are based on prototypes [1], [2]. > > [1] git clone https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git -b perf/record_threads > [2] https://lore.kernel.org/lkml/20180913125450.21342-1-jolsa@kernel.org/ > > Suggested-by: Jiri Olsa > Suggested-by: Namhyung Kim > Acked-by: Andi Kleen > Acked-by: Namhyung Kim > Reviewed-by: Riccardo Mancini > Tested-by: Riccardo Mancini > Signed-off-by: Alexey Bayduraev > --- > tools/perf/Documentation/perf-record.txt | 30 ++- > tools/perf/builtin-record.c | 314 ++++++++++++++++++++++- > tools/perf/util/record.h | 1 + > 3 files changed, 340 insertions(+), 5 deletions(-) > > diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt > index 0408e677c117..4bbdc813e2e9 100644 > --- a/tools/perf/Documentation/perf-record.txt > +++ b/tools/perf/Documentation/perf-record.txt > @@ -695,9 +695,35 @@ measurements: > wait -n ${perf_pid} > exit $? > > ---threads:: > +--threads=:: > Write collected trace data into several data files using parallel threads. > -The option creates a data streaming thread for each cpu in the system. > + value can be user defined list of masks. Masks separated by colon > +define cpus to be monitored by a thread and affinity mask of that thread > +is separated by slash: > + > + /:/:... > + > +For example user specification like the following: > + > + 0,2-4/2-4:1,5-7/5-7 is this special case? [root@krava perf]# ./perf record --threads=1/1 [root@krava perf]# ps -ef | grep perf root 132071 130979 9 22:59 pts/6 00:00:00 ./perf record --threads=1/1 [root@krava perf]# cat /proc/131798/task/*/status | grep Cpus_allowed cat: '/proc/131798/task/*/status': No such file or directory [root@krava perf]# cat /proc/132071/task/*/status | grep Cpus_allowed Cpus_allowed: ff Cpus_allowed_list: 0-7 Cpus_allowed: ff Cpus_allowed_list: 0-7 looks like the affinity was not set thanks, jirka