1

Today I broke perfmon... :(

I can start the application, the three default counters (cpu, mem, disk) are there, but the graph won't move.

The Data Source is set to "Current Activity", the "Freeze Display" button is not pressed. I just rebooted, started perfmon, and no moving graph.

I tried restoring the counters using

C:\WINDOWS\system32>lodctr.exe /R

but that did not help.

Using Windows Server 2003 R2, 32bits. A collegue also got this problem on a similar environment, but we couldn't pinpoint the reason yet.

(For the downvoter(s): I know it's not directly programming related, but writing an app for performance without any measurements to go by with is a bit hard (but that might just be me)


To make this more interesting:

The following code also does not retrieve values:

System.Diagnostics.PerformanceCounter ctr =
        new System.Diagnostics.PerformanceCounter();
ctr.CategoryName = "Processor";
ctr.CounterName = "% Processor Time";
ctr.InstanceName = "_Total";
ctr.MachineName = ".";

float val = ctr.NextValue().ToString();
// val equals 0

The image as requested:

alt text http://www.brokenwire.net/bw/file_download/23/perfmon.PNG

(So, the graph does not fill the screen, no values appear)

Michael Myers
  • 188,989
  • 46
  • 291
  • 292
thijs
  • 3,445
  • 1
  • 27
  • 46
  • 1
    Any errors in the windows event log? – Mitch Wheat Mar 23 '09 at 08:29
  • 1
    The Event log is "clean"; apart from some of these: Cannot repair performance counters for BizTalk:Message Box:General Counters service. Please re-install manually using LODCTR tool. Which happened when I ran the lodctr command. – thijs Mar 23 '09 at 08:45
  • Interesting. A bountied question can't be closed. – Henrik Paul Mar 23 '09 at 09:15
  • Update: The counters from remote machines don't work either, seems like the client side (the perfmon window itself) is malfunctioning. – thijs Jun 11 '09 at 09:18
  • Update: Now they work again. I didn't bother with them for a while, today I started perfmon, and the counters just work again! – thijs Jul 14 '09 at 12:45
  • Have you tried to re-install it? – fmsf Mar 23 '09 at 08:30
  • 1
    I can't find a way to reinstall perfmon without reinstalling windows. – thijs Mar 23 '09 at 08:57

5 Answers5

2

The accepted answer to a possibly related SO question was to call:

lodctr.exe /s:PerfStringBackup.INI

on

... a PC where perfmon works correctly

then copy the file to the affected machine, then before a call to:

lodctr.exe /R:tPerfStringBackup.INI

Community
  • 1
  • 1
JeffH
  • 10,254
  • 2
  • 27
  • 48
  • The problem in that question different: there the counter names show up as numbers instead of strings. But I'll try the fix anyway. – thijs Mar 26 '09 at 08:05
1

try the following microsoft solution:

http://support.microsoft.com/default.aspx?scid=kb;en-us;300956

it uses C:\WINDOWS\system32>lodctr.exe /R at the end but you are editing the registry, it might do the trick.

I hope it helps.

mandel
  • 2,921
  • 3
  • 23
  • 27
  • That was a lot of work, but it didn't work. I can see the counters, I can select them, but the graph is still not moving. – thijs Mar 23 '09 at 10:49
  • Is there a way you can post a screen print of some type? – mandel Mar 23 '09 at 15:00
  • I will do that later, but you can see it yourself if you start perfmon and imagine the graph not moving (staying left all the time, no measurements are taken). – thijs Mar 24 '09 at 13:15
1

Have you tried repairing your Windows Installation ? Using the Windows Installation Disc ?

abhilash
  • 5,605
  • 3
  • 36
  • 59
  • No I haven't, I'm afraid that I'll break a the configuration or user profiles if I do that. *Idea* I can try to log in with another user to see if it's user related.. – thijs Mar 24 '09 at 13:13
  • Backup your files and settings using "Files & Settings Transfer Wizard". That way even if you'd loose your files there's a way to get them back. – abhilash Mar 25 '09 at 04:53
  • Different user didn't matter, repair install doesn't work (at all) because I manually replaced the single cpu kernel with the multi-cpu kernel (all was well after that for a long while). – thijs Mar 26 '09 at 08:06
1

Right-click the graph. You said Data Source is set to Current Activity. That is on the Source tab. Go to the General tab, down to the bottom. Make sure "Sample automatically every:" is checked, and make sure the sample time is reasonable (1 is the default -- 1 second). If it's already checked, uncheck and then check it again.

DougN
  • 4,407
  • 11
  • 56
  • 81
  • I tried checking/unchecking, changing from 1 tot 10 seconds and everything in between, pressing apply, ok, restarten perfmon in between but nothing got the graph moving again... I'm starting to think that the only option is a reinstall of the machine (which sucks). – thijs Mar 26 '09 at 14:03
  • Try installing some other app that also reads the performance counters and see if they are successful. That would tell you if it's the perfmon app itself, or the performance counter infrastructure (which would be hard to break since each counter is implemented in a single DLL) – DougN Mar 26 '09 at 22:45
  • I happen to know that PA Server Monitor among many others will read performance counters directly and it has a free trial: http://www.poweradmin.com/servermonitor – DougN Mar 26 '09 at 22:46
  • I tried with custom code (which failed), I'll try the external app – thijs Mar 27 '09 at 10:09
1

It sounds like you have been working on this pretty hard. Have you checked http://www.tomshardware.com/forum/117911-45-perfmon? Then you can double check your registry to make sure it is correct. Also, if you have your windows cd, you can copy over a fresh copy of the perfmon files.

jle
  • 9,316
  • 5
  • 48
  • 67