Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2380548rdg; Mon, 16 Oct 2023 02:35:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGaYUXGuBCntIj8AJseJNe50xz+6pbyb6krNDkvCg6QytWaakE5q97lQqYKtHvot5KxfYu+ X-Received: by 2002:a92:cd8b:0:b0:34f:7e36:5f8b with SMTP id r11-20020a92cd8b000000b0034f7e365f8bmr42204704ilb.25.1697448955267; Mon, 16 Oct 2023 02:35:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697448955; cv=none; d=google.com; s=arc-20160816; b=ePz3ZeW9xHfZEakMDqU9xRv1Jn5Zdd0tgMCJ7fwM8802HQGuDIZIWYTUIWls8cqh1u oCEnWQboZ6asvvgrwxAt6OOo82yyOINcJpWIxBziYJDEFE7xxn9Qn8vOwDOGkDzbUi0K 4Ko5mLsDqK42da3ZUB/SYuO4zW4hiqILfQtBsNZfWuFU3GnoxmHMAlSut30FqOY/33E1 N7oLGal7pPEitrlk6uzUWJUibtI7PTD2Z0BFg1zByuh5nI0Tk9QoY0fHuby+UMQUdCMl zyKI/XdLykrSL37AB5VB9d984xYYGtDJg4fpAdkv//jsCRFLGlB2XGZB7KsuGjevRNAo eCnA== 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:sender:dkim-signature; bh=z29M6zjVLJvKiOvklGlopVyqGb27pfDVnnDzs1mArTs=; fh=kWrbggM5dEwR9L3q7jplHUcZYzPbX2sPtVe5Lck/y6M=; b=kgz7OUl4ziF8xQl5xeVJ9+i2MaKc5ebyvx4DQeQTQKpCau4Y4P0zD9UsoEI/3KMxS7 x/cPIplBbZd0WSyPApMxzg0pSWEXJqOg2gGJTkc4sJsdQwO3Ym1ozUj/4YKBX/RPeRZ8 4O8gw+6L5lfQWghfKotog3l9OOmaO0my3PmoVIS+S1xnIFVhQ/37KIpVClTHBoEDxj3C t+iwV5gFk/6Osd6FnObeLnoW1PLZYGbBzg/AiGc7Q9+c0WyhNynq0zNowJgV9pNkct/0 4Xlm2ygrxTwGm2+us4/LlgZM7MsNih6yhnvQyhZQqXhOXEbXTs6zbchBY5jLMeJ4Rads eOkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Z5elJXu8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id x19-20020a63f713000000b00589878c0a5bsi9953625pgh.71.2023.10.16.02.35.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 02:35:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Z5elJXu8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 922D18060077; Mon, 16 Oct 2023 02:35:52 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229666AbjJPJfo (ORCPT + 99 others); Mon, 16 Oct 2023 05:35:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230361AbjJPJfm (ORCPT ); Mon, 16 Oct 2023 05:35:42 -0400 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D987AB; Mon, 16 Oct 2023 02:35:41 -0700 (PDT) Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-9c3aec5f326so183312366b.1; Mon, 16 Oct 2023 02:35:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697448938; x=1698053738; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=z29M6zjVLJvKiOvklGlopVyqGb27pfDVnnDzs1mArTs=; b=Z5elJXu8fQ6kBoMUxzCZrbjl3NBKH1BJPPdOHTRt4A0wAc2nG4xNZktqexiFx5nVhK r375YmBtdVwC9VF/TP++r688ZwNN/MeY/6K5Y9WvWlJTU+NEEnYNABEXKQ1xszoC/eI5 TIms1s6bdwgi94nKRP0+KJ88itYlZ4a5MWmqcIQkb6kr2qozKqRvnE3+vSpdgfHQhC4e 4n2C4ZMhJDMOBS8rnCr5uUrgXpTB9EAegImMi2GED7NFoHBEAIaRhpAVj4jE1VFF9sq1 zd5FjPyVCZO8fIiCAF0X/+tSNJdtiAhm+CtC6yRD15Y/nWlSjzw5PkWthon7t36N9ns9 k6iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697448938; x=1698053738; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=z29M6zjVLJvKiOvklGlopVyqGb27pfDVnnDzs1mArTs=; b=wNcg2+OURERETW0gJq4f2N9Uw1Itlc4ESAv1H6dIU2cqdOYr04bQcLoYWI2Fshorvy T1A0Z7H9IxUpplbEIUi0c/zje1AUQkNXdh4KYwufUkibBYTmFCJpXtUaOBgWlvG9SUwC yfAcuSk3dcAc+ah8dpCqspwwyx0C2M03rMsfDAH0SC/HOMYEfijDkbbai40uv2eDUvmV evcUzg087bqB6R15B8SOkwHiHKnA6AjMKVCoCPMGquHEbYuBiAFQ+Yy3ixMnUH63zX3P 1ci23014RYtsRE/Ot+U9AywfhJKKwAO9/+u3MCGxVY1iAdCzj/YWFLv3FQqqAP17M6Bl Zyvw== X-Gm-Message-State: AOJu0YzgNBf/sxIxReQt5ULMpbR2z51w88k7bSzqqu6C6Ge0fiAWREl7 zBm9utvF01/K591BUIO1WYxwwxRA3XY= X-Received: by 2002:a17:907:dab:b0:9a1:b85d:c952 with SMTP id go43-20020a1709070dab00b009a1b85dc952mr5986039ejc.12.1697448938409; Mon, 16 Oct 2023 02:35:38 -0700 (PDT) Received: from gmail.com (1F2EF7B2.nat.pool.telekom.hu. [31.46.247.178]) by smtp.gmail.com with ESMTPSA id dk6-20020a170906f0c600b009c3827134e5sm2070082ejb.117.2023.10.16.02.35.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 02:35:37 -0700 (PDT) Sender: Ingo Molnar Date: Mon, 16 Oct 2023 11:35:35 +0200 From: Ingo Molnar To: Namhyung Kim Cc: Arnaldo Carvalho de Melo , Jiri Olsa , Ian Rogers , Adrian Hunter , Peter Zijlstra , LKML , linux-perf-users@vger.kernel.org Subject: Re: [PATCH v3] perf bench sched pipe: Add -G/--cgroups option Message-ID: References: <20231016044225.1125674-1-namhyung@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231016044225.1125674-1-namhyung@kernel.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 16 Oct 2023 02:35:52 -0700 (PDT) * Namhyung Kim wrote: > + /* try cgroup v2 interface first */ > + if (threaded) > + fd = openat(cgrp->fd, "cgroup.threads", O_WRONLY); > + else > + fd = openat(cgrp->fd, "cgroup.procs", O_WRONLY); > + > + /* try cgroup v1 if failed */ > + if (fd < 0) > + fd = openat(cgrp->fd, "tasks", O_WRONLY); > + > + if (fd < 0) { > + char mnt[PATH_MAX]; > + > + printf("Failed to open cgroup file in %s\n", cgrp->name); > + > + if (cgroupfs_find_mountpoint(mnt, sizeof(mnt), "perf_event") == 0) > + printf(" Hint: create the cgroup first, like 'mkdir %s/%s'\n", > + mnt, cgrp->name); Ok, this works too I suppose. Acked-by: Ingo Molnar Thanks, Ingo