Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp4081890rwi; Wed, 12 Oct 2022 10:18:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7OGJbhZrJxgssbdkPwp0cuXQoaX7eCX/9OGvQs5P77f6aYRALdLbfbSRwIZFeA9KWYBi3M X-Received: by 2002:a05:6402:f96:b0:459:4180:6cf4 with SMTP id eh22-20020a0564020f9600b0045941806cf4mr28664595edb.64.1665595114923; Wed, 12 Oct 2022 10:18:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665595114; cv=none; d=google.com; s=arc-20160816; b=fZMFpMS8sXmqJyPpT1Wq3ccO1dXj9boNAZVinXXbMU1ze7ioFp5AM+yfwtrHBxJiAl WhgxCmsxfChD9MY0I6tFZR4S79uvbjTHlE28I/ES5Oo/rUw3tcZB2asu6oNRV+wvPCpW 17GiS/ACbSy6yRQFEIGVBZ7+clKNwVgpBrryEJRnsF00vK0YPdc9oQii95qx0fgX0gp2 m7FckwoG3DuFm6bLauC8T/37Op+lEa9h+C/zqGoDzRuwI8WNR0voc4K0YxwAOJ5n1QNX Nn9IrTVvH9zmUPMsp8dqoMF71OW43vicco41UwBCS7YDqKBc+E54aMxm7JEhH6VIA8u7 I7fg== 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=wX/yDHI2t8BZ8sa9ntdOr+opFKUj/EAzNNBtl+0IS8I=; b=McnDrEnCP9wGe2wLsNTZLBm/AE+NLVl0nro6PHEiyhr1hfh+ux47R1/NoV2NghNtnm LcEj9zLstS9DGsQLpOTMTrSh7xkfrCM3Hx7zzMRlyEk0yaSg/nlIw7q/CL/0IsV2/IKf FHBXOYpzaW+wCNv0vWO/aqASUAzhvpedzWavVWf9SguVb8cIQGKycjNGgq1eEIs5Tkxg d9BYiycq07TREKSkDUJyvL/+SRD0erEjra5xrKaLFRK85e6wrvsy11x1naljp4rTa2Lr eyD1EKZ2tIsAvYHYzuY1YMOFJxpvzUMMEjHuyhRansk6p69JGOgy1Mm83Bu7wsiLyhGg VIwA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j20-20020a508a94000000b00457c8bad864si14788855edj.452.2022.10.12.10.18.00; Wed, 12 Oct 2022 10:18:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229546AbiJLQuy (ORCPT + 99 others); Wed, 12 Oct 2022 12:50:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229477AbiJLQuv (ORCPT ); Wed, 12 Oct 2022 12:50:51 -0400 Received: from mail-oi1-f178.google.com (mail-oi1-f178.google.com [209.85.167.178]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CDC1E0729; Wed, 12 Oct 2022 09:50:51 -0700 (PDT) Received: by mail-oi1-f178.google.com with SMTP id u15so13785853oie.2; Wed, 12 Oct 2022 09:50:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wX/yDHI2t8BZ8sa9ntdOr+opFKUj/EAzNNBtl+0IS8I=; b=JVV+tQguH+IkRIEWjF21cRDIXLlaWgIrBy+J/7V0sLxmQJWbQI8hrDPDrwm2VUk8/d 9eCuLBtJa6APmx2jXRWBjt1OAkC5ui9i/KPa3IY7PtV5MMPzyK+Ds1YJaDM+yCjOD4K8 kmB4KtiKPXcYrFr0ga7RhekmhnP1QZ86AZGRtBAt91ySOK9ZFHbYCrbp48gXkCmKvD/+ xg2JqtN7jJ04nhtPyMOY4Sj1SZR24nNfGNO9ff2bZk7U+Y3cac/K9oZ8dsqQtKOcIT5T qovBJaZLzb/1vecPK8GNOkCDCaQw/CMtST/PPgySzidtNUVD0IFrLFC855Z2PwmoG64j 55GA== X-Gm-Message-State: ACrzQf1Vie2SqgFd8uIaxqHJq6XcYJ5OUSXG2Wml/fDTrgfnRSOvv8A6 ICA1VKXR+/aryOX2bL4moikhdgitPMz6IrSE/f4= X-Received: by 2002:a05:6808:181e:b0:350:e92a:9ab1 with SMTP id bh30-20020a056808181e00b00350e92a9ab1mr2464453oib.209.1665593450439; Wed, 12 Oct 2022 09:50:50 -0700 (PDT) MIME-Version: 1.0 References: <20221012111025.30609-1-james.clark@arm.com> <62f485df-4f5e-64a2-1294-6e162de25556@arm.com> In-Reply-To: <62f485df-4f5e-64a2-1294-6e162de25556@arm.com> From: Namhyung Kim Date: Wed, 12 Oct 2022 09:50:39 -0700 Message-ID: Subject: Re: [PATCH] perf: Fix "Track with sched_switch" test by not printing warnings in quiet mode To: James Clark Cc: linux-perf-users , Arnaldo Carvalho de Melo , linux-kernel , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 12, 2022 at 4:13 AM James Clark wrote: > > > > On 12/10/2022 12:10, James Clark wrote: > > Especially when CONFIG_LOCKDEP and other debug configs are enabled, > > Perf can print the following warning when running the "Track with > > sched_switch" test: > > Oops got the wrong test name here and in the title. Should be "kernel > lock contention analysis test" Could you please resend? > > > > > Warning: > > Processed 1378918 events and lost 4 chunks! > > > > Check IO/CPU overload! > > > > Warning: > > Processed 4593325 samples and lost 70.00%! > > > > The test already supplies -q to run in quiet mode, so extend quiet mode > > to perf_stdio__warning() and also ui__warning() for consistency. I'm not sure if suppressing the warnings with -q is a good thing. Maybe we need to separate warning/debug messages from the output. Thanks, Namhyung > > > > This fixes the following failure due to the extra lines counted: > > > > perf test "lock cont" -vvv > > > > 82: kernel lock contention analysis test : > > --- start --- > > test child forked, pid 3125 > > Testing perf lock record and perf lock contention > > [Fail] Recorded result count is not 1: 9 > > test child finished with -1 > > ---- end ---- > > kernel lock contention analysis test: FAILED! > > > > Fixes: ec685de25b67 ("perf test: Add kernel lock contention test") > > Cc: Namhyung Kim > > Signed-off-by: James Clark > > --- > > tools/perf/ui/util.c | 5 +++++ > > 1 file changed, 5 insertions(+) > > > > diff --git a/tools/perf/ui/util.c b/tools/perf/ui/util.c > > index 689b27c34246..1d38ddf01b60 100644 > > --- a/tools/perf/ui/util.c > > +++ b/tools/perf/ui/util.c > > @@ -15,6 +15,9 @@ static int perf_stdio__error(const char *format, va_list args) > > > > static int perf_stdio__warning(const char *format, va_list args) > > { > > + if (quiet) > > + return 0; > > + > > fprintf(stderr, "Warning:\n"); > > vfprintf(stderr, format, args); > > return 0; > > @@ -45,6 +48,8 @@ int ui__warning(const char *format, ...) > > { > > int ret; > > va_list args; > > + if (quiet) > > + return 0; > > > > va_start(args, format); > > ret = perf_eops->warning(format, args);