Received: by 10.223.185.116 with SMTP id b49csp8704770wrg; Fri, 2 Mar 2018 06:36:19 -0800 (PST) X-Google-Smtp-Source: AG47ELt+OWcRgDijzQzIA0JaTge+XIH9eGAxbAc+gZNQBM49kTeqoOOD/xzoh6BU8yzQqljpiyRp X-Received: by 2002:a17:902:b210:: with SMTP id t16-v6mr5395922plr.373.1520001379416; Fri, 02 Mar 2018 06:36:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520001379; cv=none; d=google.com; s=arc-20160816; b=Oxa1fx3rfjXVIkfw7i/pDgu7CPB9nQRtDtIYDuWX5KKGRKAq8WrWwzcR7sFZzKxSnh kmlQ9XU8eMmxCLqxPT9IGOAy4wnosgSNT/gQvYnfw3GefpheJKvOD5kiwIZvm/951I9p I0cIQ+I3WSwzoJTKteJL31Y29FBVmz15OjYaJxGRNIrEUKqsWrbPyo8XRmq4scSGUvk6 //2m5H7llyOH8bGhzoWO/jAvTDq+yKovrfB+czdtEefmGqPGjT1l6KQwGEkAsTSHZwjC Z2zjSx8UGHYVfFkQpBaSJB1CbQhUmbzV/g7Dj76r6c4TpRANU+z4TkkPMVH/vKF2px7N 7DzA== 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=PTmjAuWzAcSe1ZHQArbh+cj1V0MTSx8ZgU9b+DrEdcw=; b=p/u2i+RHQCRYTq7nesPp/ru9yy1AYJXG7QXp+Ph+DSWvALuDrOjWkrbro7fxogIk0E F3lzajTYPmpnSwGoPA3uKNRT1asHF8V4wcR2cZ8rQLOLma6njucFqQtXZbmixYbptJ2+ vbHQIiL4/RKI4fkc7rPzCFfE40EEEf1z6u5x0RS0qDEdATGkwqVakF+bSdy+X5jH9eHI 81nYG1Fsb0kG5N4e8RIxc+6BqcCIvJ1MjcTxXSRoDF1dZ6QnYfVLzhzlGvmrVPDHwEup SatGA8wvEwzA/lMPVqGeyAQhZtqYhl3fbNcAtazfNu2ZUWr7il00TzapsiyQYxmziQ6V FtSw== 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 e6si4064460pgt.198.2018.03.02.06.35.51; Fri, 02 Mar 2018 06:36:19 -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 S1425957AbeCBJup (ORCPT + 99 others); Fri, 2 Mar 2018 04:50:45 -0500 Received: from mga18.intel.com ([134.134.136.126]:52412 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1424456AbeCBJuk (ORCPT ); Fri, 2 Mar 2018 04:50:40 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Mar 2018 01:50:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,411,1515484800"; d="scan'208";a="35379315" Received: from gvt-dell.bj.intel.com (HELO intel.com) ([10.238.154.59]) by orsmga001.jf.intel.com with SMTP; 02 Mar 2018 01:50:37 -0800 Date: Fri, 2 Mar 2018 17:41:40 +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: <20180302094140.ncypewkdg6g6rs2g@intel.com> References: <1519809638-24248-1-git-send-email-changbin.du@intel.com> <20180301022719.xyfcu5tpmadjxbut@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 > >> 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. -- Thanks, Changbin Du