Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1013619rdb; Tue, 30 Jan 2024 05:42:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IFAOdiEzAhMrg4ClaT/uOsu/cinDxxep0Sa4Btvcl0z68FxXnhzLFAkOizmYZaQQTlnXp6x X-Received: by 2002:a05:6214:1c0a:b0:686:ad1b:77b2 with SMTP id u10-20020a0562141c0a00b00686ad1b77b2mr1269365qvc.50.1706622151274; Tue, 30 Jan 2024 05:42:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706622151; cv=pass; d=google.com; s=arc-20160816; b=R+kSVKiX80J9QNaNMj3R/QY+tyqs+9lo+9ZTljPt20opMQYXFzS3bQXXydlhPe3bzS 4YHdOgqR5Huo3oqC3okbX4tCjubOKyD70UhaTlJmPDX2CTt+iB40cRepFXujnGUTDeWz loXd2ksepTv0p3cc57v066p9fH5XdoXfx2Tf09WcNLiuRvMTRGqYql6UJ3adNYuoYB41 GXuXgWExZf77rFpfN3l1qGLbXA1MhWAIr7KbaEn3d4y9uUso/8w7StJ3ClUHdgy+QrGj 9sEIUq1In0shdgNHuKLU3X21TPmTIIgGsvEBbNPTU/77rB/APzGxLMewqF75wA/cgLbl 84eg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence; bh=sGl++iIA4A9u+4qEV+u6ph09ARs/qmkRzVLAgGs2Okc=; fh=sz9ku+1hXmSEz3wT+I/KWwiT5OFqKyF4ha2+LKCg+Kw=; b=kCE9nqx3TWjgj9fX7dsK9FYFE7ukBncUyGjhmvp6KhxPHjuKE82ZGN1nvJwvLlkxtp YARrxVw/tOI/lxi0qOdipJsuUoR0IX/+Ibjt+iK0ZETJKSe1FG+Vpklhtv45dkhud/ss Q1m/4GhaWh+H6VK/IX6dO0MhcCNHEc+oMqj0wUR4xT0MfJSokyAT5EdqgfGDwneDSQ56 4gS6lV3psiRRA/EtsJqsGYl9jCPZbiP2DDsSy/NB9xbtKmMxy+TgLJ5cPm+iavI3WNbo pQ7wwI1NifoCmIfYJwyvZfJflX/a+2XsUS/By2cYc1EXBjz3QzyLHu88g/p6nV273rdP dwxg== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-44709-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44709-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id pl15-20020ad4468f000000b0068c35f28746si8436591qvb.352.2024.01.30.05.42.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 05:42:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44709-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-44709-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44709-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id D640B1C23DA4 for ; Tue, 30 Jan 2024 13:42:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AAEE76D1B8; Tue, 30 Jan 2024 13:42:25 +0000 (UTC) Received: from mail-oo1-f44.google.com (mail-oo1-f44.google.com [209.85.161.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C959159165; Tue, 30 Jan 2024 13:42:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706622145; cv=none; b=Ti+EWyIxCqetDLeJbd8lQgTVyj38TvRUN7O4RlPqEp/DJsBc4x9P7j08LpoaaWNxkbsNjU6yVPil/DrkSC+6+1v790+pGz19cqL13I+/mRYKZ3QwNMHaHWZ47PRMbgj97yPgemqX8t21knXtuMujVA4f2OTajP4DUBGty86Jbzo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706622145; c=relaxed/simple; bh=yZIuSbQwmhsNBImBxP16rMMqoK8f4QFDk5EkKtA5CJY=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=DP9vFLy0Tj04VBQijdJB7D059fMOYFgfRf+M5feNXW093eRpFFOufUP7iiXKxCY1I5KdW6aVw4HcC+9NgDWarCVbfnj+lIA83JX8DphWUQiB10Uqskkq92pDBFxAzvhzYL9BKlNcSj/WB0cAjtTrc0MujirzCdLCD1WABJRsdiQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.161.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oo1-f44.google.com with SMTP id 006d021491bc7-59a1f85923aso236658eaf.1; Tue, 30 Jan 2024 05:42:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706622143; x=1707226943; h=content-transfer-encoding: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=sGl++iIA4A9u+4qEV+u6ph09ARs/qmkRzVLAgGs2Okc=; b=BHX7OPApczGexSMZ/ylPW+g01dVce1hK3GYPovVFtF1J3BSrzkfu8msKu8+GEd0Je3 WO1rjqV4v3XZ9VA5gjUMQhDwQJw1nf7jetP4oAaSkI95ONisugQCwHAzfIR0nnB824cj oGCTtgycrltt4KlMq09O5HJD096BWS+6KprjnUIzMT0ONhsnZObgMEMZAKeFyTg347aQ tHsPHwy978HMfxjCGIoEu7gJQExaCtH+nDveYEOllrcFYCjz2P6vKcgzMVwulGRwh8b3 xZUwbQCnWM2XtaSPHx4jOZumCxVLn74em2Swg6Cy417AoaLNfKh3SMcVrZg4XLF3Ov9k PlrQ== X-Forwarded-Encrypted: i=0; AJvYcCWohR6uluzBy/vW9auzuR+vySYZ8bbPg/xSuP7yQUdNJJmKmv61s+1ccuud0O1YoeFdC8fgVpXbOPb/UAcaNQFICEo0a0s1DmgCPRNCfixfMz9Za1h2EEHV7aLJUAzTrvVWa97yUqY= X-Gm-Message-State: AOJu0YyKSTAl1tQ0xAVBZ7c99NaDipwjTmNunr3mcmVkMBYLJ+kzfv4i KBfM9pNgqSLFdOyh0x6pyrTWM0E9jofG1rAeR+LVr0qat9WUduTty0oKOJFfxyG2CtoMWk7tDBW XZm4AhII1BfTGk3fB/QJzPjZRnFUHuu3OoN0= X-Received: by 2002:a4a:dc92:0:b0:599:e8ff:66d9 with SMTP id g18-20020a4adc92000000b00599e8ff66d9mr9403802oou.1.1706622142795; Tue, 30 Jan 2024 05:42:22 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <5770175.DvuYhMxLoT@kreacher> <2192653.irdbgypaU6@kreacher> In-Reply-To: From: "Rafael J. Wysocki" Date: Tue, 30 Jan 2024 14:42:10 +0100 Message-ID: Subject: Re: [PATCH v2 02/10] PM: sleep: stats: Use an array of step failure counters To: Stanislaw Gruszka Cc: "Rafael J. Wysocki" , Linux PM , LKML , Ulf Hansson Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jan 30, 2024 at 8:02=E2=80=AFAM Stanislaw Gruszka wrote: > > On Mon, Jan 29, 2024 at 05:11:57PM +0100, Rafael J. Wysocki wrote: > > From: Rafael J. Wysocki > > > > Instead of using a set of individual struct suspend_stats fields > > representing suspend step failure counters, use an array of counters > > indexed by enum suspend_stat_step for this purpose, which allows > > dpm_save_failed_step() to increment the appropriate counter > > automatically, so that its callers don't need to do that directly. > > > > It also allows suspend_stats_show() to carry out a loop over the > > counters array to print their values. > > > > Because the counters cannot become negative, use unsigned int for > > representing them. > > > > The only user-observable impact of this change is a different > > ordering of entries in the suspend_stats debugfs file which is not > > expected to matter. > > > > Signed-off-by: Rafael J. Wysocki > > --- > > > > v1 -> v2: > > * Use one cell less in suspend_stats.step_failures[] to avoid > > introducing an unused array cell (Stanislaw). > > > > @Stanislaw: This is different from setting SUSPEND_FREEZE to 0, because > > that would complicate printing in the sysfs attributes and the debugfs > > code, so I've not added the R-by. > > LGTM. > > Reviewed-by: Stanislaw Gruszka > > > + for (step =3D SUSPEND_FREEZE; step <=3D SUSPEND_NR_STEPS; step++) > > + seq_printf(s, "failed_%s: %u\n", suspend_step_names[step]= , > > + suspend_stats.step_failures[step-1]); > > Consider (in separate patch) removing SUSPEND_NONE from suspend_step_name= s[] > and use step-1 for it as well. SUSPEND_NONE is handy for printing an empty string when there are no suspend-resume errors.