Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2536865rdb; Wed, 21 Feb 2024 10:33:39 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU2GJZePuPtRNoSvzWDz/cRH22fpeLueSZcZRDvhSGybciQuhCFF0JoeyI2/VASGuzx1YEXTtEP36n1S1wsaxOAvmvAUKkF8qr8ORlp4Q== X-Google-Smtp-Source: AGHT+IEqP06L+jfbeqgadMz5pZkgM9gjQ2nKYsWpKY2H5leSMIQgPVOhlrawGH/+0z1q7Uw+z9Ic X-Received: by 2002:a05:6808:10d5:b0:3c1:67e4:5c96 with SMTP id s21-20020a05680810d500b003c167e45c96mr5080840ois.29.1708540419303; Wed, 21 Feb 2024 10:33:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708540419; cv=pass; d=google.com; s=arc-20160816; b=zD/PSbfs7wnyouFnDX5CD+RfW1cxXP+dlefuVG3ofj76H5wEufG+PtEbnkc0ayJqlR Iu5fOIOAsmRTh2F7Fgzv8kVHj6h6dlJmGMEqr9wRttk1wJUNAVAQKCzogPlGnb7PC2K6 B3QVnSv8BBfxkf0wIjTc2quxBFiqsiFu7lORQkEaO7imHDAx3QVS/6FEvuCx5Q5gUn0i df4NUjwP3JVdqf9Z0GOBjYNXTs7+x2Hjq44cJQkNVniGxD6RpVPTDnxcozrw9T30NGHM BrO7ub7Y7WyeowkfwlhG5KkLCRTxP3NBSA+hQSRInsRHaoN7fJFqo35IsmhGyZ442wPt NRow== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date; bh=cVk1KPhLan7p0jqADDkpf4UyKT+mITfChir+oMGVJJY=; fh=BzTT73LG4BHidVkBZJbGYenXwijpa5EH+LuAVEYf9lA=; b=Q73VJyuI9dwWusicmoDinY8KliOKh9rQmIHI7/Iutjs0n2DaZWzTzELnHjBpIeQUvB BgbO9LdyGH5cSOactes+MhhvOH23tquovN4UE1hsIFRKCuqLrDU8WGxEZ5aHye7hhCgb 2KCUMQ0WhrA9W9d2Bm4OjI43OglmgpufQrb2UfWUNlnpysXMFhLSs8ND69/lGrf5pmwd MRSX2NvLkoysQ2D9l42SEbS/IJWk9Vll+xAOU+L//Lbi4dml8VGs/TIfiaQu1y40+pZi TMgxzcucnSu51saVh7c+bvPCjznviOVLTmXcwN1XTIAG5Hrh7Dto00MIweTpxZ5CSa3y BQFg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-75301-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75301-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id gc14-20020a056214230e00b0068f7f227a64si5985274qvb.488.2024.02.21.10.33.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 10:33:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-75301-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-75301-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75301-linux.lists.archive=gmail.com@vger.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 03DF21C2144E for ; Wed, 21 Feb 2024 18:33:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 56A0885655; Wed, 21 Feb 2024 18:33:24 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C868B42A8B; Wed, 21 Feb 2024 18:33:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708540403; cv=none; b=l3WUpSr6AtWwkxkqoo9cLvXQ9KEgimD1spL5bT5RHYbbhJVBtbjSbrBn6vlnHRtRYlBkK6zSVMgeaDYLwW6dppDEV1TuKWv59xZ181+6ZBH23CeMA0BdJeYi+tQRNEPDKhugIdGXCSK/lue0p8SKKEjwrWb/3f8jQVdSQnW7wrc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708540403; c=relaxed/simple; bh=ptBTLo3fWfIuf3+j4XFusTed1gyYa8nMDrNfXKxPHfg=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=lV2QIK2DdJbBDQPbyi2+O15l3fv3vW/hyAU8A1IeTTK0qNbVmnITnrB3S2AQo4T7IS6Yva+93v+5nGjPnhvZb2NPSEwzzYNWWXeBxBCexqWcMqSrIDi73DvDIyZFLqyu4lCGtrqRxdUFETo0iNmDsmDqO0B2Fp84Food1nyl9hk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E856C433C7; Wed, 21 Feb 2024 18:33:22 +0000 (UTC) Date: Wed, 21 Feb 2024 13:35:10 -0500 From: Steven Rostedt To: Vilas Bhat Cc: "Rafael J. Wysocki" , Pavel Machek , Len Brown , Greg Kroah-Hartman , Masami Hiramatsu , Mathieu Desnoyers , Saravana Kannan , kernel-team@android.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: Re: [PATCH v1] PM: runtime: add tracepoint for runtime_status changes Message-ID: <20240221133510.70b9c205@gandalf.local.home> In-Reply-To: References: <20240221164112.846409-1-vilasbhat@google.com> <20240221121420.2e32fd00@gandalf.local.home> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 21 Feb 2024 09:57:03 -0800 Vilas Bhat wrote: > > You could do what everyone else does: > > > > #define RPM_STATUS_STRINGS \ > > EM( RPM_INVALID, "RPM_INVALID" ) \ > > EM( RPM_ACTIVE, "RPM_ACTIVE" ) \ > > EM( RPM_RESUMING, "RPM_RESUMING" ) \ > > EM( RPM_SUSPENDED, "RPM_SUSPENDED" ) \ > > EMe( RPM_SUSPENDING, "RPM_SUSPENDING" ) > > > > #undef EM > > #undef EMe > > #define EM(a, b) TRACE_DEFINE_ENUM(a); > > #define EMe(a, b) TRACE_DEFINE_ENUM(a); > > > > RPM_STATUS_STRINGS > > > > #undef EM > > #undef EMe > > #define EM(a, b) { a, b }, > > #define EMe(a, b) { a, b } > > > > Thanks for the comment, Steven. I did notice both methods of defining > enum values for tracepoints and chose this method because it felt > clearer. Could you clarify on why the method you suggested is > preferred? > Sure. One big reason: It removes duplication. If you add another enum to the list, you only need to update it in one place. And it prevents the two from getting out of sync. -- Steve