Hello perfmon devolopers and users. I am currently working on my thesis project, which in short is to integrate sampling capabilities into a commercial Java virtual machine. This is achieved via the perfmon2 kernel interface and libraries. The samples obtained is then used to make various dynamic optimizations. The idea is to use one system-wide context per CPU to measure last-level cache misses using PEBS. On buffer overflow, the PEBS buffer will be read and aggregated in a data structure for further analysis by another thread.
I have managed to implement this by looking at the examples supplied with perfmon. I can create the contexts, program them, bind them to a CPU and start monitoring without any problems. The values i receive however are a little bit strange, and I wonder if anyone has a clue of what might be going on. If I for instance set the /reg_value, reg_long_reset, reg_short_reset/ and /pfm_pebs_core_smpl_arg_t.cnt_reset/ to -10000 (on pmd0), the values are initially set correctly. Every time pmd0 wraps around however, the lower 32-bits of pmd0 will be set to 0, and the upper 32 to 1. This effectively means that I can't choose any other sampling period than 2³². When I read the /pfm_ds_area_core_t.pebs_cnt_reset/ value, the correct reset value is always returned, but this doesn't reflect reality. When PMD0 wraps around, no interrupt is generated, and no overflow is registered in /pfm_pebs_core_smpl_hdr_t.overflows/. /pebs_index /is not incremented either. I have tried a lot of setup combinations in order to get this to work, but nothing has worked. PEBS monitoring on a per-thread basis works fine, so I don't think there is anything wrong with my system. I have tried this both with a 2.6.24 and 2.6.25 kernel versions, with libpfm-3.3 and 3.4 respectively. When I run with verbose & debug =1, the output looks like this: [INFO ][pfmon ] context buffer mapped @ 0x7fe406fb8000 [PERFEVTSEL0(pmc0)=0x5100c0 event_sel=0xc0 umask=0x0 os=0 usr=1 en=1 int=1 inv=0 edge=0 cnt_mask=0] INSTRUCTIONS_RETIRED [PMC0(pmd0)] [PEBS_ENABLE(pmc17)=0x1 ena=1] CPU 0 PMD 0xffffffffffffd8f0 initially: 0xffffffffffffd8f0 last reset: 0x0 diff: 0x0 count reset: 0xffffffffffffd8f0 overflows: 0 pebs_base=0xffffc2000237b100 pebs_end=0xffffc2000237c391 index=0xffffc2000237b100 intr=0xffffc2000237c150 version=1.0 entry_size=144 ds_size=72 -----------------Next poll might be--------------------------------- CPU 0 PMD 0xfffffffffb99e6a6 initially: 0xffffffffffffd8f0 last reset: 0xffffffffffffd8f0 diff: 0xfffffffffb9a0db6 number of samples = 0 count reset: 0xffffffffffffd8f0 overflows: 0 pebs_base=0xffffc2000237b100 pebs_end=0xffffc2000237c391 index=0xffffc2000237b100 intr=0xffffc2000237c150 version=1.0 entry_size=144 ds_size=72 I would be very grateful if anyone had any advice on how to get this to work. Best regards Erik Junberger ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ perfmon2-devel mailing list perfmon2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/perfmon2-devel