linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pm-graph: bug fix for bugzilla 204773
@ 2019-09-04 21:04 Todd Brandt
  0 siblings, 0 replies; only message in thread
From: Todd Brandt @ 2019-09-04 21:04 UTC (permalink / raw)
  To: linux-pm, rafael.j.wysocki, rjw; +Cc: todd.e.brandt, todd.e.brandt

Raphael, this patch fits right on top of the 5.5 release patch.
It's an important fix for a bug found when running -dev mode.

Fix bugzilla issue 204773
https://bugzilla.kernel.org/show_bug.cgi?id=204773

sleepgraph:
- kprobe_events won't set correctly if the data is buffered
- force sysvals.setVal to be unbuffered and use binary mode
- tested in both python2 and python3

Signed-off-by: Todd Brandt <todd.e.brandt@linux.intel.com>
---
 tools/power/pm-graph/sleepgraph.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/power/pm-graph/sleepgraph.py b/tools/power/pm-graph/sleepgraph.py
index 1794c79a7d1b..f7d1c1f62f86 100755
--- a/tools/power/pm-graph/sleepgraph.py
+++ b/tools/power/pm-graph/sleepgraph.py
@@ -667,19 +667,19 @@ class SystemValues:
 		if linesack < linesout:
 			return False
 		return True
-	def setVal(self, val, file, mode='w'):
+	def setVal(self, val, file):
 		if not os.path.exists(file):
 			return False
 		try:
-			fp = open(file, mode)
-			fp.write(val)
+			fp = open(file, 'wb', 0)
+			fp.write(val.encode())
 			fp.flush()
 			fp.close()
 		except:
 			return False
 		return True
-	def fsetVal(self, val, path, mode='w'):
-		return self.setVal(val, self.tpath+path, mode)
+	def fsetVal(self, val, path):
+		return self.setVal(val, self.tpath+path)
 	def getVal(self, file):
 		res = ''
 		if not os.path.exists(file):
-- 
2.17.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-09-04 21:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-04 21:04 [PATCH] pm-graph: bug fix for bugzilla 204773 Todd Brandt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).