performancecounter

PerformanceCounter creation take a LONG time

若如初见. 提交于 2019-12-05 05:03:30
I'm working on a charge balancing system and thus I need to know the charge of each machine. PerformanceCounter seem the way to go, but creating the first one take between 38 and 60 sec. Each subsequent new Counter or 'NextValue' call is nearly instant however. Here is the code I'm using : [TestClass] public class PerfMon { [TestMethod] public void SimpleCreationTest() { Stopwatch Time = new Stopwatch(); Time.Start(); Debug.WriteLine("Time is : " + Time.ElapsedMilliseconds); // Create PerformanceCounter RAM = new PerformanceCounter("Memory", "Available MBytes"); Debug.WriteLine("Time is : " +

Two TLB-miss per mmap/access/munmap

江枫思渺然 提交于 2019-12-05 03:12:35
for (int i = 0; i < 100000; ++i) { int *page = mmap(NULL, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); page[0] = 0; munmap(page, PAGE_SIZE); } I expect to get ~100000 dTLB-store-misses in userspace, one per each iteration (Also ~100000 page-faults and dTLB-load-misses for kernel). Running following command, the result is roughly 2x what I expect. I would appreciate if someone could clarify why this is the case: perf stat -e dTLB-store-misses:u ./test Performance counter stats for './test': 200,114 dTLB-store-misses 0.213379649 seconds time elapsed P.S. I have

Keep target address of load in register until instruction is retired

筅森魡賤 提交于 2019-12-05 01:31:46
I want to use Precise Event-Based Sampling (PEBS) to record all the addresses of specific events (say cache misses for example), on a XeonE5 Sandy Bridge. However, the Performance Analysis Guide for Core TM i7 Processor and Intel® XeonTM 5500 processors , p.24, contains the following warning: As the PEBS mechanism captures the values of the register at completion of the instruction, the dereferenced address for the following type of load instruction (Intel asm convention) cannot be reconstructed. MOV RAX, [RAX+const] This kind of instruction is mostly associated with pointer chasing mystruc =

Explanation about high-resolution performance counter and its existence related to .NET Stopwatch?

丶灬走出姿态 提交于 2019-12-05 01:24:09
Inside the static Stopwatch constructor we can see the following code, that basicly checks whether a high-resolution performance counter exists. static Stopwatch() { if (!SafeNativeMethods.QueryPerformanceFrequency(out Frequency)) { IsHighResolution = false; Frequency = 0x989680L; tickFrequency = 1.0; } else { IsHighResolution = true; tickFrequency = 10000000.0; tickFrequency /= (double) Frequency; } } On MSDN it says about QueryPerformanceFrequency : Retrieves the frequency of the high-resolution performance counter, if one exists It's pretty unclear, however, when exactly does it exist? I

C# Performance Counter Help, Nvidia GPU

怎甘沉沦 提交于 2019-12-04 23:57:09
问题 So I've been experimenting with the performance counter class in C# and have had great success probing the CPU counters and almost everything I can find in the windows performance monitor. HOWEVER, I cannot gain access to the "NVIDIA GPU" category... So for example, the following line of code is how it usually works. PerformanceCounter cpuCounter = new PerformanceCounter("Processor", "% Processor Time", "_Total"); That code works fine, but the GPU category that appeared in the performance

Understanding Memory Performance Counters

不问归期 提交于 2019-12-04 23:38:07
问题 [Update - Sep 30, 2010] Since I studied a lot on this & related topics, I'll write whatever tips I gathered out of my experiences and suggestions provided in answers over here- 1) Use memory profiler (try CLR Profiler, to start with) and find the routines which consume max mem and fine tune them, like reuse big arrays, try to keep references to objects to minimal. 2) If possible, allocate small objects (less than 85k for .NET 2.0) and use memory pools if you can to avoid high CPU usage by

Which perf events can use PEBS?

天大地大妈咪最大 提交于 2019-12-04 11:50:25
I want to understand which events can have the precise modifier on my CPU (Sandy Bridge). Intel Software Developer's Manual (Table 18-32. PEBS Performance Events for Intel Microarchitecture Code Name Sandy Bridge) contains only the following events: INST_RETIRED , UOPS_RETIRED , BR_INST_RETIRED , BR_MISP_RETIRED , MEM_UOPS_RETIRED , MEM_LOAD_UOPS_RETIRED , MEM_LOAD_UOPS_LLC_HIT_RETIRED . And SandyBridge_core_V15.json lists the same events with PEBS > 0. However there are some examples of using perf , which add :p to the cycles event. And I can successfully run perf record -e cycles:p on my

Application counters in Linux? (and OSX?)

那年仲夏 提交于 2019-12-04 10:53:50
问题 I'm trying to figure out if there is a library that gives me something near the equivalent of Windows custom performance counters (described here http://geekswithblogs.net/.NETonMyMind/archive/2006/08/20/88549.aspx) Basically, I'm looking for something that can be used to both track global counters within an application, and (ideally) something that presents that information via a well-defined interface to other applications/users. These are application statistics; stuff like memory and disk

Performance Counter Instance Name vs. Process Name

北慕城南 提交于 2019-12-04 10:04:46
I am connecting to various performance counters in the Process category. I am using the following c# method to determine the instance name to use when acquiring the counters: private const string _categoryName = "Process"; private const string _processIdCounter = "ID Process"; public static bool TryGetInstanceName(Process process, out string instanceName) { PerformanceCounterCategory processCategory = new PerformanceCounterCategory(_categoryName); string[] instanceNames = processCategory.GetInstanceNames(); foreach (string name in instanceNames) { using (PerformanceCounter processIdCounter =

Measuring TLB miss handling cost in x86-64

早过忘川 提交于 2019-12-04 09:25:20
问题 I want to estimate the performance overhead due to TLB misses on a x86-64 (Intel Nehalem) machine running Linux. I wish to get this estimate by using some performance counters. Does anybody has some pointers on what is the best way to estimate this? Thanks Arka 回答1: If you can get access to a "Westmere" based system the performance characteristics of your code should be quite similar to what you have on the "Nehalem", but you will have access to a new hardware performance counter event that