RE: WMI

  • From: "Sina Bahram" <sbahram@xxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Wed, 13 Jan 2010 11:24:22 -0500

Well I think an interesting question to ask; therefore, is what does WMI map
to on the backend? Is this using the x86 timing instruction to ascertain the
information, querying the ACPI table for the various statistics, or what?

It seems that for the non-application level WMI tasks, it queries the WDM
for the backend, so I'm guessing ACPI or other techniques in the kernel are
used to expose this information.

Here's the Wikipedia article on the subject.  Interestingly they mention WMI
support for windows related objects is "not?" supported in Vista and later,
which makes no sense to me unless if it was replaced with something?

http://en.wikipedia.org/wiki/Windows_Management_Instrumentation

Here's the WMI page from Microsoft ... Has pretty good resources actually.

http://msdn.microsoft.com/en-us/library/aa394582(VS.85).aspx

Take care,
Sina

-----Original Message-----
From: programmingblind-bounce@xxxxxxxxxxxxx
[mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Alex Hall
Sent: Wednesday, January 13, 2010 11:08 AM
To: programmingblind@xxxxxxxxxxxxx
Subject: Re: WMI

I want the load per core, though, so my dual core AMD should give me two 
percentage numbers, one per core, but it only gives me one. A forum post I 
came across says that this number is not even an average, but the load of 
just the first core. Why is my second core being ignored? I get the 
information in a loop, as my code said, but all I get is the first of the 
two cores?


Have a great day,
Alex
Email: mehgcap@xxxxxxxxx
----- Original Message ----- 
From: "Sina Bahram" <sbahram@xxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Wednesday, January 13, 2010 10:58
Subject: RE: WMI


> Keep in mind you can have up to two logical processors per core, and these
> days you can have up to four or six cores, so with hyperthreading, if you
> have a six core processor with HT, you'll have twelve logical processors 
> to
> iterate through.
>
> Logical processors which share the same core, I think, and strong emphasis
> on the think, have to run at the same clockspeed until very recently, 
> since
> all hyperthreading is, is the addition of some ALUs to the di.
>
> Take care,
> Sina
>
> -----Original Message-----
> From: programmingblind-bounce@xxxxxxxxxxxxx
> [mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Alex Hall
> Sent: Wednesday, January 13, 2010 8:52 AM
> To: programmingblind@xxxxxxxxxxxxx
> Subject: Re: WMI
>
> I am not looking for how many processors I have, but rather each
> core's LoadPercentage. It seems like LoadPercentage goes to
> NumberOfProcessors and not LogicalProcessors, and I want to get the
> load for each Logical processor and not Physical processor.
>
> On 1/13/10, Johannes Grib <johannesg@xxxxxxxxx> wrote:
>> Hello Alex,
>> "NumberOfLogicalProcessors" might be the property you're looking for?
>>
>> Under XP I get the following when "print p"
>>
>> instance of Win32_Processor
>> {
>> AddressWidth = 32;
>> Architecture = 0;
>> Availability = 3;
>> Caption = "x86 Family 6 Model 15 Stepping 6";
>> CpuStatus = 1;
>> CreationClassName = "Win32_Processor";
>> CurrentClockSpeed = 2131;
>> CurrentVoltage = 16;
>> DataWidth = 32;
>> Description = "x86 Family 6 Model 15 Stepping 6";
>> DeviceID = "CPU0";
>> ExtClock = 266;
>> Family = 2;
>> L2CacheSize = 2048;
>> Level = 6;
>> LoadPercentage = 0;
>> Manufacturer = "GenuineIntel";
>> MaxClockSpeed = 2131;
>> Name = "Intel(R) Core(TM)2 CPU          6400  @ 2.13GHz";
>> NumberOfCores = 1;
>> NumberOfLogicalProcessors = 2;
>> PowerManagementSupported = FALSE;
>> ProcessorId = "BFEBFBFF000006F6";
>> ProcessorType = 3;
>> Revision = 3846;
>> Role = "CPU";
>> SocketDesignation = "";
>> Status = "OK";
>> StatusInfo = 3;
>> Stepping = "6";
>> SystemCreationClassName = "Win32_ComputerSystem";
>> SystemName = "JOHANNESSP2";
>> UpgradeMethod = 1;
>> Version = "Model 15, Stepping 6";
>> };
>>
>>
>>
>> -----Original Message-----
>> From: programmingblind-bounce@xxxxxxxxxxxxx
>> [mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Alex Hall
>> Sent: Wednesday, January 13, 2010 4:48 AM
>> To: programmingblind@xxxxxxxxxxxxx
>> Subject: WMI
>>
>> Hi all,
>> I am playing around with WMI, trying to get the load of both cores of my
>> dual core AMD processor. However, I am only getting one number, not two 
>> as
> I
>> would expect. I thought I would get two numbers returned (I itterate
> through
>> all the processors, at least I think I do). It is the same for all the
> other
>> properties I have tried (clock speed, socket, more), just one piece of
>> information, not one per core. Is there a way to get info about each 
>> core,
>> or is this processor-specific? Windows 7 64 bit. Python code is below.
>>
>>
>> import os, sys, wmi, win32com.client
>> speaker=win32com.client.Dispatch("Say.Tools");
>> c=wmi.WMI();
>> for p in c.win32_Processor():
>>  speaker.say(p.LoadPercentage);
>> # end for
>> speaker=None;
>>
>> Have a great day,
>> Alex
>> Email: mehgcap@xxxxxxxxx
>>
>> __________
>> View the list's information and change your settings at
>> //www.freelists.org/list/programmingblind
>>
>> __________
>> View the list's information and change your settings at
>> //www.freelists.org/list/programmingblind
>>
>>
>
>
> -- 
> Have a great day,
> Alex
> My email is now: mehgcap@xxxxxxxxx
> __________
> View the list's information and change your settings at
> //www.freelists.org/list/programmingblind
>
>
> __________
> View the list's information and change your settings at
> //www.freelists.org/list/programmingblind
>
> 

__________
View the list's information and change your settings at 
//www.freelists.org/list/programmingblind


__________
View the list's information and change your settings at 
//www.freelists.org/list/programmingblind

Other related posts: