Received: by 10.223.185.116 with SMTP id b49csp8430655wrg; Fri, 2 Mar 2018 01:26:16 -0800 (PST) X-Google-Smtp-Source: AG47ELv5tYUEC31oSr/9kOjFPwhvEsQKsPZ6qGarbbUgpXE9kwDSXjqtBggdpE/zvgphMIqUmvvV X-Received: by 2002:a17:902:b109:: with SMTP id q9-v6mr4803143plr.340.1519982776066; Fri, 02 Mar 2018 01:26:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519982776; cv=none; d=google.com; s=arc-20160816; b=bGpskLgCZcToBZZ8hozHP3ln+4PBozJnUprDJtZ30HC5oW/va6pes/I8FF06g4yVr/ 70Y7gm/dXkroUV5hMkA1mxzuSKsO53F7Y9EQFPa6W3y+y3J6kJCpnaHn1IsHF24dlnth RgM8Sb7uxhn3A9OKahlxbPivGk+pMcjGXL1Np3aq26bqLMzLfFqZcDj3ypR7sfDzn8TP uW34f4820/JOzmLVjFHIw5shIJfHBoSi+mLVgU1tOfUjlQQLvVG6rPjNqIAmVKlhkAHB huDYLPi2M83sYxcMXQoZuzozzfjM/SHEJv45nquStHibid4A+53Q9dY4mW0ZDIz8l9ty m6lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=ttafLQaaYDfQwErWGyi9yw/m3n6ZZhY5pKAgPumaW34=; b=O9GM4OV5DcLUzNwKRilRlHJ7UJGusJF+/7GKOd7a8PHUX5VEBduVkan2GKJ2k399Jc PP0HeDmJ+T4O75azD/wcyO0i74HAf5a7tXs3RKn+B5mQ4h3K7Rm/SW0y9FoOt9uoYKoW yw94Ndap68yHe5uwb4hM93QIyAzwG5PCmnsnJD9sTC1eEF1WvfMBzToCBorfnv/msvGZ 7/1NRm2BgJdf2Xf6ILe08yDkFFQfhe30Xv6HtFepbkUTWJRTFa0pBMB981oT8m5blvjQ x/J8h5xk93KqDUumnJ6BWl1VuqCe6YcR1xyM6y611mubDNOz7CJa9smyhWFJBzrjRUEC opng== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=tDPM7tO0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n10-v6si4508104plp.33.2018.03.02.01.26.01; Fri, 02 Mar 2018 01:26:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=tDPM7tO0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1425695AbeCBJZA (ORCPT + 99 others); Fri, 2 Mar 2018 04:25:00 -0500 Received: from mail-oi0-f66.google.com ([209.85.218.66]:45193 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1425679AbeCBJYq (ORCPT ); Fri, 2 Mar 2018 04:24:46 -0500 Received: by mail-oi0-f66.google.com with SMTP id j79so6589553oib.12; Fri, 02 Mar 2018 01:24:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=ttafLQaaYDfQwErWGyi9yw/m3n6ZZhY5pKAgPumaW34=; b=tDPM7tO0KTp+aaNO080T3gnM6e4uuAMEG7Hy50MQy747bHjpudneq8Z8dqPdWOoFpE Ob6KOg+941oiL/85leECQggly3WBeWpZ5PcE2B0uXMms8dSFJHN+chtN24x9ttJGHAoI l/2sWb24JWy6fJrIze7wcNmyqvuuq4bs8ksH9KDse+CsYKL2pT/ZuwdIS5a+j/E0qCKg 9a2UtloirzpyxW4+eJgI16FtLlVOJvI1JVsaiH3a/dnnhsMT8yz35SKlKwZmMyEMJ0j1 RezydjWAtyJP2DfaUlfoIaPMhBbgZzUqXgnNuyyqK4c26AZMRUEKMsGZp0CVGnVhQDgY xiEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=ttafLQaaYDfQwErWGyi9yw/m3n6ZZhY5pKAgPumaW34=; b=d0jxSnfEzqoOznDDWc2XlB6ttfeAx/GI0ZNv04n7ufs+8OESNJjZnC+VoR4i85uPOf QeH9rYbRQHkCmyszYvozry/lWHr6n5Pkh8feymPFU3IbBDoLKe1xeg8s+qVgkvkgWGDb a99jYfWvQmJvPoO0tzMzRNk0dcuLDNVnQyqpsK4OfMCs8P14PQp2GvCb2SA0L8ugbKia MIUyTGMKU/BwAMNFYuqUpkD2gwt8n6EX/DmOozp5mt5CPXGSOatR96xbtMwiGD4ToJ6w gC+FFD3VWBVjTpkYzlwRc3e4LH9NC3AY6oDpBo/u9ipIq5ne6ZfuKt7Z+TdCZx2TdX4q iWPA== X-Gm-Message-State: AElRT7HvQpSrsSGb1NoybcVyIZq9UXk8/FguDJDS0OuLDw4W2KvTl54Y HJectWyDPyKdgf9W4WQKppn0xBzot5UDUsai5UQ= X-Received: by 10.202.231.196 with SMTP id e187mr3023172oih.358.1519982685538; Fri, 02 Mar 2018 01:24:45 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.44.146 with HTTP; Fri, 2 Mar 2018 01:24:45 -0800 (PST) In-Reply-To: <20180301022719.xyfcu5tpmadjxbut@intel.com> References: <1519809638-24248-1-git-send-email-changbin.du@intel.com> <20180301022719.xyfcu5tpmadjxbut@intel.com> From: "Rafael J. Wysocki" Date: Fri, 2 Mar 2018 10:24:45 +0100 X-Google-Sender-Auth: UF_87xB1x8f_Fdy8hG538J2ypbE Message-ID: Subject: Re: [PATCH v2] tracing/power: Polish the tracepoints cpu_idle and cpu_frequency To: "Du, Changbin" Cc: "Rafael J. Wysocki" , Rafael Wysocki , Linux PM , Steven Rostedt , Ingo Molnar , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [Fix up LKML address.] On Thu, Mar 1, 2018 at 3:27 AM, Du, Changbin wrote: > Hi, > On Wed, Feb 28, 2018 at 11:27:09AM +0100, Rafael J. Wysocki wrote: >> On Wed, Feb 28, 2018 at 10:20 AM, wrote: >> > From: Changbin Du >> > >> > The type of state is signed int, convert it to unsigned int looks weird. >> > (-1 become 4294967295) >> > 932.123 power:cpu_idle:state=1 cpu_id=0) >> > 932.125 power:cpu_idle:state=4294967295 cpu_id=0) >> > 932.132 power:cpu_idle:state=1 cpu_id=0) >> > 932.133 power:cpu_idle:state=4294967295 cpu_id=0) >> > >> > Similarly for cpu_frequency as "state=%lu cpu_id=%lu". User need to read >> > the code to understand what 'state' means. >> > >> > No functional change in this patch. >> >> That rather isn't the case if negative values are ever passed to the >> tracepoint, right? >> > yes. >> Which seems to be the reason why you want to make this change, isn't it? >> > yes, to improve readability. > >> So maybe fix the code using the tracepoint(s) to avoid passing >> negative values to it(them)? > For cpu_idle event, [0, CPUIDLE_STATE_MAX) are used to index the idle state arrary, > so I think a appropriate value for PWR_EVENT_EXIT is -1 (defined in include/trace/events/power.h). > Or do you have a better idea? Thanks! Sorry, I'm not sure what you mean. I'm saying that the code using the CPU PM tracepoints is not expected to pass -1 as the CPU number to them. IOW, neither -1 nor its UL representation should ever appear in the output of these tracepoints. If that happens, it is a problem with the code using the tracepoints which needs to be fixed. Users should not see any of these values.