This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Some Problem come out during runing systemtap module on Android phone.


>On your guesswork,  why do you think the qualcomm  inserts the line?

I have unfortunately no clue as I am not really knowledgeable into that part.


>.Other questions.
>
>I want to monitor the CPU time occupation of some process,
>and also to monitor the reduction of kernel memory which is
>caused from the abnormal memory usage of some process .

We never really tracked memory with systemtap but http://sourceware.org/systemtap/examples/ provides several examples in memory/ (kmalloc-top, mmfilepage, vm.tracepoints, ...). Mmmmh I assume you have to know a bit about memory allocation (which I am also not really versed into ;-) ). Generally I have a good look to tapset, it helps (tapset/memory.stp here)

For CPU time, frankly, "top" is accurate enough for time occupation (and Android one has been rewritten in 200 lines, which makes it easy to add features or more precision to %). We use systemtap mostly to study sequences and observe pre-emptions. Processtimes.stp is very interesting but we preferred moving post-processing on host. So we use scheduler.cpu_on and scheduler.wakeup probes in general (to track context switches and differentiate task waiting in Queued or Sleep sate)

We have seen some issues in the past on Android, which were thought as a setup issue so we cheat a bit (unlike Ubuntu, why is Android always an issue ? ;-) ) so we use the function probe rather than the tapset. We shall take time to recheck.

We try to trace the least necessary info possible:
probe kernel.function("finish_task_switch") {
  printf("%d %c %s:%d\n", <some function to get absolute time, 32kHz timer or gettimeofday_us()>, 48 + cpu(), execname(), tid())
}

probe kernel.function("try_to_wake_up") {
  printf("%d %c  Wakeup: %s:%d\n", <some function to get time>, 48 + task_cpu($p), kernel_string($p->comm), $p->pid)
}

You get:
6 1 swapper:0 -> idle task on CPU 1
26 1 systemtap/1:2690 -> hey, systemtap is scheduled on core 1
28 1 swapper:0 -> execution time of systemtap/1 is then 28 - 26
279 0 dsi:301 -> work queue on core 0

It is not different from a scheduler trace (ftrace, perf, ...) but we customize size/content of trace per our needs

Regards
Fred
Texas Instruments France SA, 821 Avenue Jack Kilby, 06270 Villeneuve Loubet. 036 420 040 R.C.S Antibes. Capital de EUR 753.920




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]