Received: by 10.223.185.116 with SMTP id b49csp8893680wrg; Fri, 2 Mar 2018 09:42:24 -0800 (PST) X-Google-Smtp-Source: AG47ELvupqIu3WirHhuPABmum5e88dpEu7VYQ1yRlsadWQWzwhWrepthl2djLqgQEVNQXNV972+L X-Received: by 10.98.245.131 with SMTP id b3mr6460230pfm.20.1520012544692; Fri, 02 Mar 2018 09:42:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520012544; cv=none; d=google.com; s=arc-20160816; b=tJ2oZDqFx91UOvKe/NgW5CAoEQ+YW4Ya/dptZ/lk+Y7CgPaGnE8V1AEvbpQ4Z4Xo8t Ku5t8wlxGm1T/HZK4oa0vdNps///Pzhls582Bdb8Mr40YP05iYtkLqpT6E4YBIBfrUpV ZPTYs2KuDsv3ycn4t3xPP6l1FHoDdCgMtSvTXAoqbsptZEYK9clzWnmQwxM2P9A2DW2o CmB/vFr7o8Nt3YwA+bogLlCLOlT1iIHURW+OubtiVe/827RY6jvXJA811AfuX+AtuqNQ EEPTXstkUyPH6UHFiJ+nmLolMDT3dS8c9FGdviwQ3sUQq5VyBMTcoSmzQkAqndG5502l uRMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=z9VCiYSkd45bgQqchP1hIXAIgv8aDQsGFzaGOLaAuUA=; b=xKLva92rDJFARMnqIOqlw2Q2KfMYPa/JE2LAC9oFSkYdzv1NVg/f9NgK0BebcMUVOJ H/TZao6wSU3KuunkZiwurzsEsMwTplbFz7t80qp41EhXjsj2rbL9lz6sbUNZXiuMvu0V 09q1aHoDMwwtc0/hOw+kFNN6v5P0tbDFvXhzE8jlC9JvTPZ66o1yYpeGlXQWPX39Q/9X GzSf3m/wQXm/h/w28qkf0Y3S0fjRlEksGrfS/0WSrCpWGXt9ZD64RmhUG8UuSkGSeMtM jh1mitoO+AAfrfVtgytz4t9xfiKYCkFq1vbXFpGIfhvN2PQrASPxu7+NtejRLUg68RkS VXjg== ARC-Authentication-Results: i=1; mx.google.com; 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 x205si4236546pgx.402.2018.03.02.09.42.09; Fri, 02 Mar 2018 09:42:24 -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; 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 S1426350AbeCBKYU (ORCPT + 99 others); Fri, 2 Mar 2018 05:24:20 -0500 Received: from mga05.intel.com ([192.55.52.43]:59528 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1424145AbeCBKYP (ORCPT ); Fri, 2 Mar 2018 05:24:15 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Mar 2018 02:24:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,411,1515484800"; d="scan'208";a="208331319" Received: from gvt-dell.bj.intel.com (HELO intel.com) ([10.238.154.59]) by fmsmga006.fm.intel.com with SMTP; 02 Mar 2018 02:24:11 -0800 Date: Fri, 2 Mar 2018 18:15:14 +0800 From: "Du, Changbin" To: "Rafael J. Wysocki" Cc: "Du, Changbin" , Rafael Wysocki , Linux PM , Steven Rostedt , Ingo Molnar , Linux Kernel Mailing List Subject: Re: [PATCH v2] tracing/power: Polish the tracepoints cpu_idle and cpu_frequency Message-ID: <20180302101514.uvuhl4ve7q3ptq3n@intel.com> References: <1519809638-24248-1-git-send-email-changbin.du@intel.com> <20180301022719.xyfcu5tpmadjxbut@intel.com> <20180302094140.ncypewkdg6g6rs2g@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20171027-42-ad8712 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 02, 2018 at 11:18:10AM +0100, Rafael J. Wysocki wrote: > On Fri, Mar 2, 2018 at 10:41 AM, Du, Changbin wrote: > >> >> 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. > > > > This patch only changed 'state' field but cpuid. For cpu_idle event, 'state' is > > singned value, but for cpu_frequency it is unsinged. > > The cpuid is always unsinged value. So no one passes -1 as CPU number. > > You are right, 'state' not 'cpuid', sorry. > > Negative 'state' should not be passed to these tracepoints too, though. The current situtation is that 'state' can be negative for event cpu_idle :(. This is why I made this change. -- Thanks, Changbin Du