This trace is the result of the execution of the test taskset.json available in the repository (direct link to the test input).
Code: Select all
{
"resources": 2,
"shared": 50,
"threads": {
"thread1": {
"priority": 10,
"cpus": [0,1,2],
"phases": {
"c0": { "loops": 1000 },
"l0": { "loops": 2000, "res": 0 },
"s0": { "loops": 1000 },
"l1": { "loops": 3000, "res": 1 },
"m0": { "loops": 1000, "memory": 10 },
"c1": { "loops": 5000 }
},
"analysis": { "supply": true, "statistical": true,
"runmap": true, "migrations": true }
},
"thread2": {
"priority": 10,
"cpus": [0,1],
"phases": {
"c0": { "loops": 5000 },
"m0": { "loops": 1000, "memory": 10 },
"s0": { "loops": 5000 },
"l0": { "loops": 10000, "res": 1 }
}
}
},
"global": {
"default_policy": "SCHED_RR",
"duration": 10,
"analysis": { "supply": true }
}
}
The first thread has a job composed of 6 phases and can run on CPUs 0, 1 and 2 (set via the affinity mask of the thread).
For each job (repeated until the test ends) the first threads computes (phase starting with the letter c) 1000 mathematical operations, then locks (phase starting with the letter l) the mutex corresponding to resource 0 and computes for 2000 mathematical operations before unlocking it, then it uses a shared memory buffer (phase starting with the letter s) consisting of 50 double values created at the beginning of the execution, computing for 1000 mathematical operations and circularly writing the results in the buffer, then it does a second lock phase computing for 3000 mathematical operations and locking and releasing resource 1, then it allocates a buffer of memory consisting in 10 double values and computes for 1000 mathematical operations writing circularly on the buffer (phase starting with the letter m) and finally it computes again for 5000 mathematical operations.
This is encoded in the description of the job given in taskset.json:
Code: Select all
"phases": {
"c0": { "loops": 1000 },
"l0": { "loops": 2000, "res": 0 },
"s0": { "loops": 1000 },
"l1": { "loops": 3000, "res": 1 },
"m0": { "loops": 1000, "memory": 10 },
"c1": { "loops": 5000 }
}
The attached file taskset.txt contains the trace as it is generated by the execution of the application and tracer.
With the command
Code: Select all
cat taskset.txt | grep tracing_mark_write
Code: Select all
head -n1000 taskset.txt | grep tracing_mark_write
Code: Select all
<...>-3359 [002] 308616.223620: print: tracing_mark_write: [1] begins job 150
<...>-3360 [000] 308616.223836: print: tracing_mark_write: [2] begins job 150
<...>-3359 [002] 308616.223947: print: tracing_mark_write: [1] begins job 151
<...>-3360 [000] 308616.224187: print: tracing_mark_write: [2] begins job 151
<...>-3359 [002] 308616.224326: print: tracing_mark_write: [1] begins job 152
<...>-3360 [000] 308616.224543: print: tracing_mark_write: [2] begins job 152
<...>-3359 [002] 308616.224682: print: tracing_mark_write: [1] begins job 153
<...>-3360 [000] 308616.224894: print: tracing_mark_write: [2] begins job 153
<...>-3359 [002] 308616.225033: print: tracing_mark_write: [1] begins job 154
<...>-3360 [000] 308616.225250: print: tracing_mark_write: [2] begins job 154
<...>-3359 [002] 308616.225361: print: tracing_mark_write: [1] begins job 155
<...>-3360 [000] 308616.225601: print: tracing_mark_write: [2] begins job 155
<...>-3359 [002] 308616.225740: print: tracing_mark_write: [1] begins job 156
<...>-3360 [000] 308616.225957: print: tracing_mark_write: [2] begins job 156
<...>-3359 [002] 308616.226096: print: tracing_mark_write: [1] begins job 157
<...>-3360 [000] 308616.226308: print: tracing_mark_write: [2] begins job 157
<...>-3359 [002] 308616.226447: print: tracing_mark_write: [1] begins job 158
<...>-3360 [000] 308616.226664: print: tracing_mark_write: [2] begins job 158
<...>-3359 [002] 308616.226775: print: tracing_mark_write: [1] begins job 159
To obtain the migrations occurred, one can simply do
Code: Select all
head -n1000 taskset.txt | grep sched_migrate_task
Code: Select all
head -n1000 taskset.txt | grep sched_migrate_task | grep application
Code: Select all
<...>-3358 [000] 308615.136218: sched_migrate_task: comm=application pid=3358 prio=120 orig_cpu=0 dest_cpu=0
<...>-3358 [000] 308615.136230: sched_migrate_task: comm=application pid=3359 prio=120 orig_cpu=0 dest_cpu=3
<...>-30 [003] 308615.136265: sched_migrate_task: comm=application pid=3359 prio=120 orig_cpu=3 dest_cpu=0
<...>-3357 [002] 308615.136279: sched_migrate_task: comm=application pid=3359 prio=120 orig_cpu=0 dest_cpu=2
<...>-3358 [000] 308615.136283: sched_migrate_task: comm=application pid=3358 prio=120 orig_cpu=0 dest_cpu=0
<...>-3358 [000] 308615.136292: sched_migrate_task: comm=application pid=3360 prio=120 orig_cpu=0 dest_cpu=1
<...>-3354 [003] 308615.136304: sched_migrate_task: comm=application pid=3360 prio=120 orig_cpu=1 dest_cpu=3
<...>-30 [003] 308615.136319: sched_migrate_task: comm=application pid=3360 prio=120 orig_cpu=3 dest_cpu=0
As a final note, in the tool we post process the traces and we obtain different and more compact representations for the same thing. For more details, visit the tool repository.