开发者

Windows cli tool to monitor semaphores?

In Windows, is there a tool to view semaphores from the command 开发者_如何学JAVAline?

SysInternals "Process Explorer" does a great job from a gui, and the SysInternals "handle.exe" view handles from the command line, but I've not found anything to enumerate semaphores from the command line?


handle.exe -s -p [processid]

will give the number of semaphores for that process id. Here is the output of

handle.exe -s -p 388

where 388 is the process id of a Chrome tab I have running.

Handle v3.51 Copyright (C) 1997-2013 Mark Russinovich Sysinternals - www.sysinternals.com

Handle type summary:
  ALPC Port       : 2
  Desktop         : 1
  Directory       : 4
  EtwRegistration : 25
  Event           : 37
  File            : 14
  IoCompletion    : 2
  Key             : 7
  KeyedEvent      : 1
  Mutant          : 4
  Section         : 14
  Semaphore       : 27
  Thread          : 16
  Timer           : 1
  TpWorkerFactory : 8
  WindowStation   : 2
Total handles: 165

handle.exe -a -p [processid] 

will list all the handles with their types; you could use something like grep:

handle.exe -a -p 388 | grep Semaphore

to get output like this:

  20C: Semaphore
  210: Semaphore
  218: Semaphore
  21C: Semaphore
  220: Semaphore
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜