PDA

View Full Version : Trouble with Typperf.exe ignoring instance numbers


Felix Baum
December 11th 03, 09:24 PM
Looks like Typeperf.exe has a bug that doesn't allow the
values in the second, third, etc instances of an perfmon
object to be captured.

There are two HelloWorld.exe processes running on my test
machine, tstexec.
They should be visible as HelloWorld and HelloWorld#1
The first process has around 110 threads, and the second
has around 180.
Check this out.

---
C:\>typeperf.exe "\\tstexec\Process(HelloWorld)\Thread
Count" -sc 1

"(PDH-CSV 4.0)","\\tstexec\Process(HelloWorld)\Thread
Count"
"05/08/2003 11:02:13.435","109.000000"

The command completed successfully.

C:\>typeperf.exe "\\tstexec\Process(HelloWorld#1)\Thread
Count" -sc 1

"(PDH-CSV 4.0)","\\tstexec\Process(HelloWorld)\Thread
Count"
"05/08/2003 11:02:23.449","109.000000"

The command completed successfully.

C:\>typeperf.exe "\\tstexec\Process(HelloWorld#2)\Thread
Count" -sc 1

"(PDH-CSV 4.0)","\\tstexec\Process(HelloWorld)\Thread
Count"
"05/08/2003 11:02:37.079","109.000000"

The command completed successfully.
---

It looks like typeperf.exe is stripping off the instance
number.

Using the -qx flag, I displayed the available counters on
tstexec.
It shows HelloWorld and HelloWorld#1, so they _should_ be
accessible.

---
Administrator@tstmonitor /cygdrive/c
$ typeperf.exe -qx "\tstexec\Process" | grep -i
HelloWorld | grep -i "thread count"

\\tstexec\Process(HelloWorld)\Thread Count
\\tstexec\Process(HelloWorld#1)\Thread Count

Administrator@tstmonitor /cygdrive/c
$
---

I tried Escape characters. They didn't help.

---
C:\>typeperf.exe "\\tstexec\Process(HelloWorld^#1)\Thread
Count" -sc 1

"(PDH-CSV 4.0)"
"05/08/2003 11:10:06.274","-1"

Error:
The data is not valid.

C:\>typeperf.exe "\\tstexec\Process(HelloWorld^#^1)
\Thread Count" -sc 1

"(PDH-CSV 4.0)"
"05/08/2003 11:10:11.532","-1"

Error:
The data is not valid.

C:\>typeperf.exe "\\tstexec\Process(HelloWorld\#1)\Thread
Count" -sc 1

"(PDH-CSV 4.0)"
"05/08/2003 11:14:12.909","-1"

Error:
The data is not valid.

C:\>typeperf.exe "\\tstexec\Process(HelloWorld\#\1)
\Thread Count" -sc 1

"(PDH-CSV 4.0)"
"05/08/2003 11:14:21.231","-1"

Error:
The data is not valid.

C:\>

---

The workaround, I suppose, would be to copy
HelloWorld.exe to, say, HelloWorld1.exe and start the
second process with the copy of the executable.

But that's a completely hideous solution.

Am I doing something horribly wrong?
If not, is there a less buggy version of typeperf.exe
available?
I have version 5.1.2600.1

Cheers,

Felix

Google