New profile protocol

- when kernel profiles a process for the first time it saves an entry
  describing the process [endpoint|name]

- every profile sample is only [endpoint|pc]

- profile utility creates a table of endpoint <-> name relations and
  translates endpoints of samples into names and writing out the
  results to comply with the processing tools

- "task" endpoints like KERNEL are negative thus we must cast it to
  unsigned when hashing
This commit is contained in:
Tomas Hruby
2010-09-23 10:49:39 +00:00
parent 123a968be3
commit db12229ce3
6 changed files with 121 additions and 33 deletions
+12
View File
@@ -20,6 +20,14 @@
/* user address to write info struct */
PRIVATE vir_bytes sprof_info_addr_vir;
PRIVATE clean_seen_flag(void)
{
int i;
for (i = 0; i < NR_TASKS + NR_PROCS; i++)
proc[i].p_misc_flags &= ~MF_SPROF_SEEN;
}
/*===========================================================================*
* do_sprofile *
*===========================================================================*/
@@ -62,6 +70,8 @@ PUBLIC int do_sprofile(struct proc * caller, message * m_ptr)
sprofiling = 1;
clean_seen_flag();
return OK;
case PROF_STOP:
@@ -82,6 +92,8 @@ PUBLIC int do_sprofile(struct proc * caller, message * m_ptr)
data_copy(KERNEL, (vir_bytes) &sprof_info,
sprof_ep, sprof_info_addr_vir, sizeof(sprof_info));
clean_seen_flag();
return OK;
default: