All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaroslav Skarvada <jskarvad at redhat.com>
To: powertop@lists.01.org
Subject: [Powertop] Fix for some 'requesting unregistered parameter'
Date: Tue, 29 Oct 2013 05:18:06 -0400	[thread overview]
Message-ID: <435649119.17204207.1383038286562.JavaMail.root@redhat.com> (raw)
In-Reply-To: 277223620.17203495.1383038201970.JavaMail.root@redhat.com

[-- Attachment #1: Type: text/plain, Size: 144 bytes --]

Hi,

the attached patch may fix 'requesting unregistered parameter' for cases
if e.g NIC was added after calibration

regards

Jaroslav

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-network-fixed-requesting-unregistered-parameter-if-N.patch --]
[-- Type: text/x-patch, Size: 1485 bytes --]

From d1daec6fd9c1d6534d81df1c3c73de9d714b7196 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= <jskarvad@redhat.com>
Date: Tue, 29 Oct 2013 10:12:12 +0100
Subject: [PATCH] network: fixed 'requesting unregistered parameter' if NIC is
 added
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
---
 src/devices/network.cpp | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/src/devices/network.cpp b/src/devices/network.cpp
index d0827ef..002600b 100644
--- a/src/devices/network.cpp
+++ b/src/devices/network.cpp
@@ -345,11 +345,32 @@ const char * network::device_name(void)
 
 static void netdev_callback(const char *d_name)
 {
+	char devname[128];
+
 	std::string f_name("/sys/class/net/");
 	if (strcmp(d_name, "lo") == 0)
 		return;
 
 	f_name.append(d_name);
+
+	sprintf(devname, "%s-up", d_name);
+	register_parameter(devname);
+
+	sprintf(devname, "%s-powerunsave", d_name);
+	register_parameter(devname);
+
+	sprintf(devname, "%s-link-100", d_name);
+	register_parameter(devname);
+
+	sprintf(devname, "%s-link-1000", d_name);
+	register_parameter(devname);
+
+	sprintf(devname, "%s-link-high", d_name);
+	register_parameter(devname);
+
+	sprintf(devname, "%s-packets", d_name);
+	register_parameter(devname);
+
 	network *bl = new(std::nothrow) class network(d_name, f_name.c_str());
 	if (bl) {
 		all_devices.push_back(bl);
-- 
1.8.3.1


             reply	other threads:[~2013-10-29  9:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-29  9:18 Jaroslav Skarvada [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-10-29 11:27 [Powertop] Fix for some 'requesting unregistered parameter' Sergey Senozhatsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=435649119.17204207.1383038286562.JavaMail.root@redhat.com \
    --to=powertop@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.