Received: by 10.223.185.116 with SMTP id b49csp8471321wrg; Fri, 2 Mar 2018 02:19:56 -0800 (PST) X-Google-Smtp-Source: AG47ELvu4TrMEaFqGzcyeaaiG4JfvS7+G3ayxPo7IFprvNbrnqBkdEKE2GLE5dIl2hZvK6FaIJD2 X-Received: by 10.101.100.87 with SMTP id s23mr4194329pgv.413.1519985996059; Fri, 02 Mar 2018 02:19:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519985996; cv=none; d=google.com; s=arc-20160816; b=YAgQwwiyt5/egpSvmrS0CFqEJeMyYCe4O2O9Qr1VEIXVK16vscOTvHc7Z8jGsMB9AM Ee436lkDKlQGubVkJGlLbzcPFQnI9rvzQQnVBIj4+R653NO6XbzEOZthpS2/TsoRLsJy 9XFMVvKuOEnA4Q8JyvQ+SJE4+kB1eFT3c9xei5LC/lvjpO8AQA1sVjb4ozrMCYcb9d2X tcRRiQyFF2mkHAtfaAmDCWYMS6rJImrBPoT2htrCMNvfNAZjFe9TJmiFNc4NGLM7PdUp ZPOEAqUPfhG9bKvsMchSyquYWzKbjEpBqBQKfkArWR9PudFjhKVvWX2DUPz6lw6n0kFe hpQw== 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=UpziK4W2+JUAigWOgDP0WyyZH+KQtlO0pv80yYscfhs=; b=SytDqFfUSmJ2EUf1aKzE4l3r2zOnLVeUx3npmgN19wj25MNG+cU+Pfn727g+0swKJS LD1764+eZG9BwL7AJDNYQPmTvxkUBht3MvZY6MbZZU6L70+34Nm68dIhyRVYUH5RPN/K a7j115DGIE6FfoqqNW2eAAwNq/zPFcIyMH7jaEyTb9F18wSFfRAYvcLE3+FyQzEJ8KlJ xMR/JHnnHuaUDSgz/yhGpmqAVlpUV7xBeA0bOeb2oaZEzOTaea98hfUcVQYAc8t2bIbM 87auM/qSQgMwjLZeGaUPQe04G1pVE6LKwt1KfnCvL5C/umux+dZnyTWi/5V+wSF2vsSf Tp+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=mLp50twV; 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 m68si3814678pgm.88.2018.03.02.02.19.41; Fri, 02 Mar 2018 02:19:56 -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=mLp50twV; 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 S1945968AbeCBKSq (ORCPT + 99 others); Fri, 2 Mar 2018 05:18:46 -0500 Received: from mail-oi0-f46.google.com ([209.85.218.46]:33840 "EHLO mail-oi0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1424221AbeCBKSN (ORCPT ); Fri, 2 Mar 2018 05:18:13 -0500 Received: by mail-oi0-f46.google.com with SMTP id c83so6699759oib.1; Fri, 02 Mar 2018 02:18:11 -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=UpziK4W2+JUAigWOgDP0WyyZH+KQtlO0pv80yYscfhs=; b=mLp50twVR5GIckoaRXo2ahDp8CagBK2ViwWa3As3tNQiA24ipIZ4DebHvjj+TNap7c V0b3nPM974VjhFSA/MSSq3kPxFZ034AhwAUrkOn1anLvoGTrb9CX/j4xM0yHksZk5mar A+iPlFyU1i2iAPUEqmJLU2nJVMWhuDMqBlV4hmo4L87kvuAgtA6HZelrBzq1qoOXRBJq K6Wim1Qn5uz1z0NCouzzcOfY/u6HtBvcAVbRZUFgi+MKWGkhgwsrhAB/4SOzZX7gbDD7 EUmZjLkE9CMijWOv3Q/9pl1dh7yBnrq3GdCegK3X0fZgpHg7jX4QyY/y1RdwakUROrGt u1Ww== 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=UpziK4W2+JUAigWOgDP0WyyZH+KQtlO0pv80yYscfhs=; b=syIfUzA/Gwiu/2qiQ4g7HP7rvefgz9iTIVPtUYlNuZ5cNctBnst7+fS6ojfBKSLSuc JE/OkcrGRo6tyrV3DvOJDKpNOxUYuD/d0glyFPYOJH8e6XomRdGtBJ7OU8s9/Su2xo4F F2FNOIEJ9yKV4z0/yqPKA+4JHzkA1WQO49tBweDYJ/By6rXAqHPQw4z/onLPzzusIpfb Ng0cvrMQO9QztNOo6fWlDwSAFD9O3C8SY0F8jeVXFV4uggTi4DhDGpZnL0WcT+wt0vy+ OwlP6lWSaeCKb3Oqnrqx78vM9urPdt3skpflQBovxj1/yHn709IC4/Hfpy/fv90RUAxl vUew== X-Gm-Message-State: APf1xPAiOKRldQRitfkJBu3ujn5TXNvdTE/BUNrJYRXbCyYw5oq88n4M QRanBDeQ8pwO8HZ47PWQ0VD6GCGJUy3X5iHl5ms= X-Received: by 10.202.108.73 with SMTP id h70mr3094364oic.282.1519985890775; Fri, 02 Mar 2018 02:18:10 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.44.146 with HTTP; Fri, 2 Mar 2018 02:18:10 -0800 (PST) In-Reply-To: <20180302094140.ncypewkdg6g6rs2g@intel.com> References: <1519809638-24248-1-git-send-email-changbin.du@intel.com> <20180301022719.xyfcu5tpmadjxbut@intel.com> <20180302094140.ncypewkdg6g6rs2g@intel.com> From: "Rafael J. Wysocki" Date: Fri, 2 Mar 2018 11:18:10 +0100 X-Google-Sender-Auth: SGO8HWsoehkz7YZTOYfT0HXnnyI 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 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.