Words by Matt Mackall [Fri, May 11, 2007 at 09:39:05PM -0500]:Then again, perhaps you have /proc/tstats instead. If so apply this (well, you get the idea): --- powertop/powertop.c 2007-05-12 05:01:15.000000000 +0100 +++ powertop_new/powertop.c 2007-05-12 05:08:46.000000000 +0100 @@ -212,8 +212,8 @@ void stop_timerstats(void) { FILE *file; - file = fopen("/proc/timer_stats","w"); - if (!file) { + if (!(file = fopen("/proc/timer_stats","w")) && + !(file = fopen("/proc/stats","w")) ) { nostats = 1; return; } @@ -223,8 +223,8 @@ void start_timerstats(void) { FILE *file; - file = fopen("/proc/timer_stats","w"); - if (!file) { + if (!(file = fopen("/proc/timer_stats","w")) && + !(file = fopen("/proc/stats","w")) ) { nostats = 1; return; } @@ -388,7 +388,7 @@ i = 0; totalticks = 0; if (!nostats) - file = popen("cat /proc/timer_stats | sort -n | tail -190", "r"); + file = popen("cat /proc/timer_stats 2>>/dev/null|| cat /proc/tstats | sort -n | tail -190", "r"); while (file && !feof(file) && i<190) { char *count, *pid, *process, *func; int cnt; -- Jose Celestino ---------------------------------------------------------------- http://www.msversus.org/ ; http://techp.org/petition/show/1 http://www.vinc17.org/noswpat.en.html ---------------------------------------------------------------- "And on the trillionth day, Man created Gods." -- Thomas D. Pate -
| Peter Zijlstra | [RFC][PATCH 7/7] lockdep: spin_lock_nest_lock() |
| Gabriel C | Re: 2.6.24-rc2-mm1 |
| Andrew Morton | Re: [PATCH 2.6.21] cramfs: add cramfs Linear XIP |
| Jiri Kosina | Re: 2.6.21-rc5-mm4 |
git: | |
| Gregory Haskins | [RFC PATCH 00/17] virtual-bus |
| Jarek Poplawski | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| David Miller | [GIT]: Networking |
| Gerrit Renker | [PATCH 0/37] dccp: Feature negotiation - last call for comments |
