Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2540118rdb; Wed, 21 Feb 2024 10:41:23 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVMrTYTvjS+iKOibCWu+KttU7nDifhwp96bDHkRPM20KfRywnCPJmhhLCe3iIwGOuF+QHRR7TBlEAz8IvVOn5Z//WrljJOLC8rUGzguHA== X-Google-Smtp-Source: AGHT+IFUZVudF9udF+f67dWeCwG5QgCLOb4XQNhYkQF2T2Ws60lvmWJk6nh2ryDsT/SWLZzIUMU+ X-Received: by 2002:a05:6830:1e50:b0:6e2:baa0:76db with SMTP id e16-20020a0568301e5000b006e2baa076dbmr17569820otj.6.1708540883216; Wed, 21 Feb 2024 10:41:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708540883; cv=pass; d=google.com; s=arc-20160816; b=NpI+ad9WQFhNyYzqOua1KET2ghna0bZq5fC69V91DJwIFP0JKNVu20ulMQqjhxoGE0 ykBA5kZzmejJ1S5Da+u5uIHHgsOab6R1LTkvQ7VaRJp44V+fBJ5dtAoc68A3htM35fv7 mC7Mw6dzZ5ZLQ2Y9LlSboTYrIMSFqHRunt1qY0c/+zUF28B+QFbwXiyazdmtU+nOhzfq 7C521YWRQdIBidV7IesefbQL2BHsWfNvoj10+bz/nSSeYOvtWTAmBVEPjVygJxzaBCkH BzptssE5yjm1eBbQWJXPc/2xC31nhbibs+43V1nRyRkn53uPmdzvz7NLUy67KCuVtaWu X7jg== 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:dkim-signature; bh=nv9wNDwhY/zzzSGkgxd05pBE2QIgBpN8eK7x1JDY4VQ=; fh=X6lZZ6BUsxHDu9kQwJ7oz5tav2CNQGOcwlRZnJ+ZF6k=; b=igdcUEBr90qNbxpPLfgeNUMHr9wx0QdZ+qbeNma6uRDObEDKJ+kiQPfdauO7DdGU4a n2LjMpgwgD8fVHG/tC9W+3mD91ufqYPp2i3wY2gGbSFtkCOy51tW3ZjyXVyzXpsW9UH2 /VN2+7CgaGhFqE4zIUn+2FzK84SWOD6ThggllSbGrOjm1fgNrPqnt+TZmBbQVi7IFKiC aYCeEwaq6pJ2M80TX4mZz3HBh4sObUp8+ZhxX0seq9akjzU6inBg5NSpStqCdNqqGzN1 chwQ+xdbilLEjxB+ZIOnRRBzidBETr1BorSONCpm7S8N70E3sO3F+PdtYo+r5cZYLeMs HBBA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=p3pUDBBh; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-75323-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75323-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id c19-20020ac85a93000000b0042df364fbd7si11369818qtc.546.2024.02.21.10.41.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 10:41:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-75323-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; dkim=pass header.i=@google.com header.s=20230601 header.b=p3pUDBBh; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-75323-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75323-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 D7A351C24EFA for ; Wed, 21 Feb 2024 18:41:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 19A808592B; Wed, 21 Feb 2024 18:41:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="p3pUDBBh" Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) (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 AFD1B85275 for ; Wed, 21 Feb 2024 18:41:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708540874; cv=none; b=IO90c78BUKaZNH+b8YQgD2jPmE+Rto3W4aoKvpg2uR4diAOTmcj78hxdVVsNw+OsApm/MxWjqjuW49AKpJ2g1pqrIBUU34AifVCV5/PRdfhOHx2lsL4ngdi95tMnP/4M+Gv6x7vwSnJ9J4/3y7iETm5kyr+j5fMVb9ltohZI70M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708540874; c=relaxed/simple; bh=qoRTyEELbWf2nDMxqqkDGPdA78HiotxsFiUP1rN/C7c=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=oDD8sFBWQpcNhXGGX7nmBvesJwYToN8t2K8MB+kjHejcsOp7TRLW+6YU7ca6cH5gLGJvK+tvPjevpBS5xP6bhp++pmtDZwzXBfg/hbYWLWEnOpSdlYT0vnTbByHhGsEZEHZvX7dg0o5pKgMm92k+ARF3edBG6sPtOWPTQ9+8B8A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=p3pUDBBh; arc=none smtp.client-ip=209.85.208.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-5650c27e352so1504a12.0 for ; Wed, 21 Feb 2024 10:41:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1708540871; x=1709145671; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=nv9wNDwhY/zzzSGkgxd05pBE2QIgBpN8eK7x1JDY4VQ=; b=p3pUDBBh1iYee1IdYIHLIDnMhVNw+Z+WYqekHCye3dJyztDCVLWaOAoYUD2lb8KBrM sDQrxdZByzKI0W0gIpaqPp6H0RsqDB21aaSsnW1KrHDjUQHdOrzd2oFm0vbeY+TdbFmw fYXBZUvUAz7jOwStAM4VDVRVdQVd4RBw1lwi/nrOkeWcrMSOWzZchiW7vY4WtPwjKCFp ZdwaG1gfogBTLCn7fE1Iy3S9Eb7qo8I9PF4JvHOnXKos+ibLC/k3L2P+kbaupflfXP1u WHuBZPbfzgflf0dc25ckRXi6pDhlvUKrwD9f64YPPf9YC9qGAn3KvhGu7jOw9D2ISkKX HhcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708540871; x=1709145671; 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=nv9wNDwhY/zzzSGkgxd05pBE2QIgBpN8eK7x1JDY4VQ=; b=kKUcux6DnuQKfugli2KnHJbxpq3N/hbAPiHc9EJEu8cQLW/8lNxFxi9BDPWZBA5si1 qvAP3U+uxgesEGBQ5rDGQsEwKOjkgA/ysLoZAYZDhzaeOem5p9D3/QLhjfYxvt6rJgJD /HmuumcoWpxL3L8NN/5IU/42nJWuE00WKlTLFkxfTQN0KiwdoFIU5fQMR6c1PjPnTgz3 tthsyum43Yu9msFFgmOr3Z23a/zImy7Vun8rk0OD0NcHMKb5FjzoAmPseFQOyGUVnR7g jLU+VLDUnAixiXcD4VqQVLzsScoIjwU8NFmnyUPsjeIw9vZyzbzdEQaUcBzQbEXSw+rs gRQw== X-Forwarded-Encrypted: i=1; AJvYcCVCd0nAX412CEoS42DGoxGRW0bnOtiakEpTOdTzLKkqO+Qkw4UE8S07Xx68BPfBKDUNfy4gsT7H1yr+tBeuqFSgnWyXV+2KaxoP5qUF X-Gm-Message-State: AOJu0YxkzTQh9m8tTijQxiRX21Lfy4OuVo2TB7tsrUC1YpsPIW3j5SDn nV70ipiKimeZmAGLveMqbtJxXucFBG2Vvua/ew0ME/aijYzMw7Oft/vja4qdo5d/+Zk5/a/rvNS uMant6YjImmRoyC4sBRBmIbXYLpHkt/LKrfhV X-Received: by 2002:a50:f615:0:b0:564:e627:9e22 with SMTP id c21-20020a50f615000000b00564e6279e22mr253194edn.4.1708540870884; Wed, 21 Feb 2024 10:41:10 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240221164112.846409-1-vilasbhat@google.com> <20240221121420.2e32fd00@gandalf.local.home> <20240221133510.70b9c205@gandalf.local.home> In-Reply-To: <20240221133510.70b9c205@gandalf.local.home> From: Vilas Bhat Date: Wed, 21 Feb 2024 10:40:58 -0800 Message-ID: Subject: Re: [PATCH v1] PM: runtime: add tracepoint for runtime_status changes To: Steven Rostedt 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Feb 21, 2024 at 10:33=E2=80=AFAM Steven Rostedt wrote: > > 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 That makes sense! Thanks. I will revise the patch and send a new version so= on.