<feed xmlns='http://www.w3.org/2005/Atom'>
<title>android_kernel_zuk_msm8996.git/include/trace, branch master</title>
<subtitle>null
</subtitle>
<link rel='alternate' type='text/html' href='http://git.compromyse.xyz/android/android_kernel_zuk_msm8996.git/'/>
<entry>
<title>writeback: Fix cgroup_path() return value check</title>
<updated>2023-10-27T16:44:47+00:00</updated>
<author>
<name>LuK1337</name>
<email>priv.luk@gmail.com</email>
</author>
<published>2023-10-27T16:44:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.compromyse.xyz/android/android_kernel_zuk_msm8996.git/commit/?id=8a021c2fe1db1b3a376a563d0156e9488d9f5aff'/>
<id>8a021c2fe1db1b3a376a563d0156e9488d9f5aff</id>
<content type='text'>
cgroup_path() returns length, not char *.

Change-Id: I8bdfcc0fc58789aa23f730866f27fbb932b24be1
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
cgroup_path() returns length, not char *.

Change-Id: I8bdfcc0fc58789aa23f730866f27fbb932b24be1
</pre>
</div>
</content>
</entry>
<entry>
<title>BACKPORT: ANDROID: Add hold functionality to schedtune CPU boost</title>
<updated>2023-07-26T19:01:08+00:00</updated>
<author>
<name>Chris Redpath</name>
<email>chris.redpath@arm.com</email>
</author>
<published>2018-02-27T15:55:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.compromyse.xyz/android/android_kernel_zuk_msm8996.git/commit/?id=b755fbd9cb18e4b6755f7fe9891d8bdd21c4f65b'/>
<id>b755fbd9cb18e4b6755f7fe9891d8bdd21c4f65b</id>
<content type='text'>
* Render - added back missing header

When tasks come and go from a runqueue quickly, this can lead to boost
being applied and removed quickly which sometimes means we cannot raise
the CPU frequency again when we need to (due to the rate limit on
frequency updates). This has proved to be a particular issue for RT tasks
and alternative methods have been used in the past to work around it.

This is an attempt to solve the issue for all task classes and cpufreq
governors by introducing a generic mechanism in schedtune to retain
the max boost level from task enqueue for a minimum period - defined
here as 50ms. This timeout was determined experimentally and is not
configurable.

A sched_feat guards the application of this to tasks - in the default
configuration, task boosting only applied to tasks which have RT
policy. Change SCHEDTUNE_BOOST_HOLD_ALL to true to apply it to all
tasks regardless of class.

It works like so:

Every task enqueue (in an allowed class) stores a cpu-local timestamp.
If the task is not a member of an allowed class (all or RT depending
upon feature selection), the timestamp is not updated.
The boost group will stay active regardless of tasks present until
50ms beyond the last timestamp stored. We also store the timestamp
of the active boost group to avoid unneccesarily revisiting the boost
groups when checking CPU boost level.

If the timestamp is more than 50ms in the past when we check boost then
we re-evaluate the boost groups for that CPU, taking into account the
timestamps associated with each group.

Idea based on rt-boost-retention patches from Joel.

Change-Id: I52cc2d2e82d1c5aa03550378c8836764f41630c1
Suggested-by: Joel Fernandes &lt;joelaf@google.com&gt;
Reviewed-by: Patrick Bellasi &lt;patrick.bellasi@arm.com&gt;
Signed-off-by: Chris Redpath &lt;chris.redpath@arm.com&gt;
Signed-off-by: RenderBroken &lt;zkennedy87@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Render - added back missing header

When tasks come and go from a runqueue quickly, this can lead to boost
being applied and removed quickly which sometimes means we cannot raise
the CPU frequency again when we need to (due to the rate limit on
frequency updates). This has proved to be a particular issue for RT tasks
and alternative methods have been used in the past to work around it.

This is an attempt to solve the issue for all task classes and cpufreq
governors by introducing a generic mechanism in schedtune to retain
the max boost level from task enqueue for a minimum period - defined
here as 50ms. This timeout was determined experimentally and is not
configurable.

A sched_feat guards the application of this to tasks - in the default
configuration, task boosting only applied to tasks which have RT
policy. Change SCHEDTUNE_BOOST_HOLD_ALL to true to apply it to all
tasks regardless of class.

It works like so:

Every task enqueue (in an allowed class) stores a cpu-local timestamp.
If the task is not a member of an allowed class (all or RT depending
upon feature selection), the timestamp is not updated.
The boost group will stay active regardless of tasks present until
50ms beyond the last timestamp stored. We also store the timestamp
of the active boost group to avoid unneccesarily revisiting the boost
groups when checking CPU boost level.

If the timestamp is more than 50ms in the past when we check boost then
we re-evaluate the boost groups for that CPU, taking into account the
timestamps associated with each group.

Idea based on rt-boost-retention patches from Joel.

Change-Id: I52cc2d2e82d1c5aa03550378c8836764f41630c1
Suggested-by: Joel Fernandes &lt;joelaf@google.com&gt;
Reviewed-by: Patrick Bellasi &lt;patrick.bellasi@arm.com&gt;
Signed-off-by: Chris Redpath &lt;chris.redpath@arm.com&gt;
Signed-off-by: RenderBroken &lt;zkennedy87@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>sched/fair: remove energy_diff tracepoint in preparation to re-factoring</title>
<updated>2023-07-26T19:01:08+00:00</updated>
<author>
<name>Patrick Bellasi</name>
<email>patrick.bellasi@arm.com</email>
</author>
<published>2017-06-28T14:59:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.compromyse.xyz/android/android_kernel_zuk_msm8996.git/commit/?id=706997f4805b35fe541315558bbf79fa07e3ae9e'/>
<id>706997f4805b35fe541315558bbf79fa07e3ae9e</id>
<content type='text'>
The format of the energy_diff tracepoint is going to be changed by the
following energ_diff refactoring patches. Let's remove it now to start from
a clean slate.

Change-Id: Id4f537ed60d90a7ddcca0a29a49944bfacb85c8c
Signed-off-by: Patrick Bellasi &lt;patrick.bellasi@arm.com&gt;
Signed-off-by: Chris Redpath &lt;chris.redpath@arm.com&gt;
Signed-off-by: Quentin Perret &lt;quentin.perret@arm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The format of the energy_diff tracepoint is going to be changed by the
following energ_diff refactoring patches. Let's remove it now to start from
a clean slate.

Change-Id: Id4f537ed60d90a7ddcca0a29a49944bfacb85c8c
Signed-off-by: Patrick Bellasi &lt;patrick.bellasi@arm.com&gt;
Signed-off-by: Chris Redpath &lt;chris.redpath@arm.com&gt;
Signed-off-by: Quentin Perret &lt;quentin.perret@arm.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>sched/walt: Re-add code to allow WALT to function</title>
<updated>2023-07-16T10:47:43+00:00</updated>
<author>
<name>Ethan Chen</name>
<email>intervigil@gmail.com</email>
</author>
<published>2018-01-21T00:35:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.compromyse.xyz/android/android_kernel_zuk_msm8996.git/commit/?id=c0fa7577022c4169e1aaaf1bd9e04f63d285beb2'/>
<id>c0fa7577022c4169e1aaaf1bd9e04f63d285beb2</id>
<content type='text'>
Change-Id: Ieb1067c5e276f872ed4c722b7d1fabecbdad87e7
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: Ieb1067c5e276f872ed4c722b7d1fabecbdad87e7
</pre>
</div>
</content>
</entry>
<entry>
<title>locks: sprinkle some tracepoints around the file locking code</title>
<updated>2022-10-28T14:39:29+00:00</updated>
<author>
<name>Jeff Layton</name>
<email>jeff.layton@primarydata.com</email>
</author>
<published>2016-01-07T02:26:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.compromyse.xyz/android/android_kernel_zuk_msm8996.git/commit/?id=af53549b43c53bdad679704df2e99a8eeb0ca05a'/>
<id>af53549b43c53bdad679704df2e99a8eeb0ca05a</id>
<content type='text'>
Add some tracepoints around the POSIX locking code. These were useful
when tracking down problems when handling the race between setlk and
close.

Signed-off-by: Jeff Layton &lt;jeff.layton@primarydata.com&gt;
Acked-by: "J. Bruce Fields" &lt;bfields@fieldses.org&gt;
Change-Id: I270eda634890d21399ccf939ad6d03b7d201a148
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add some tracepoints around the POSIX locking code. These were useful
when tracking down problems when handling the race between setlk and
close.

Signed-off-by: Jeff Layton &lt;jeff.layton@primarydata.com&gt;
Acked-by: "J. Bruce Fields" &lt;bfields@fieldses.org&gt;
Change-Id: I270eda634890d21399ccf939ad6d03b7d201a148
</pre>
</div>
</content>
</entry>
<entry>
<title>cgroup: add tracepoints for basic operations</title>
<updated>2022-04-18T21:51:41+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2016-08-10T15:23:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.compromyse.xyz/android/android_kernel_zuk_msm8996.git/commit/?id=b0d7bc01c2ad39eaa6e214ee7dd23f3f96ed671d'/>
<id>b0d7bc01c2ad39eaa6e214ee7dd23f3f96ed671d</id>
<content type='text'>
Debugging what goes wrong with cgroup setup can get hairy.  Add
tracepoints for cgroup hierarchy mount, cgroup creation/destruction
and task migration operations for better visibility.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Chatur27 &lt;jasonbright2709@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Debugging what goes wrong with cgroup setup can get hairy.  Add
tracepoints for cgroup hierarchy mount, cgroup creation/destruction
and task migration operations for better visibility.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Chatur27 &lt;jasonbright2709@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>BACKPORT: bpf: permit multiple bpf attachments for a single perf event</title>
<updated>2022-04-18T21:51:32+00:00</updated>
<author>
<name>Yonghong Song</name>
<email>yhs@fb.com</email>
</author>
<published>2017-10-24T06:53:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.compromyse.xyz/android/android_kernel_zuk_msm8996.git/commit/?id=a85b6c28bb287439916716f124450ceb79a1624f'/>
<id>a85b6c28bb287439916716f124450ceb79a1624f</id>
<content type='text'>
This patch enables multiple bpf attachments for a
kprobe/uprobe/tracepoint single trace event.
Each trace_event keeps a list of attached perf events.
When an event happens, all attached bpf programs will
be executed based on the order of attachment.

A global bpf_event_mutex lock is introduced to protect
prog_array attaching and detaching. An alternative will
be introduce a mutex lock in every trace_event_call
structure, but it takes a lot of extra memory.
So a global bpf_event_mutex lock is a good compromise.

The bpf prog detachment involves allocation of memory.
If the allocation fails, a dummy do-nothing program
will replace to-be-detached program in-place.

Signed-off-by: Yonghong Song &lt;yhs@fb.com&gt;
Acked-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Martin KaFai Lau &lt;kafai@fb.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
(cherry picked from commit e87c6bc3852b981e71c757be20771546ce9f76f3)
Signed-off-by: Connor O'Brien &lt;connoro@google.com&gt;
Bug: 121213201
Bug: 138317270
Test: build &amp; boot cuttlefish; attach 2 progs to 1 tracepoint
Change-Id: I390d8c0146888ddb1aed5a6f6e5dae7ef394ebc9
Signed-off-by: Chatur27 &lt;jasonbright2709@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch enables multiple bpf attachments for a
kprobe/uprobe/tracepoint single trace event.
Each trace_event keeps a list of attached perf events.
When an event happens, all attached bpf programs will
be executed based on the order of attachment.

A global bpf_event_mutex lock is introduced to protect
prog_array attaching and detaching. An alternative will
be introduce a mutex lock in every trace_event_call
structure, but it takes a lot of extra memory.
So a global bpf_event_mutex lock is a good compromise.

The bpf prog detachment involves allocation of memory.
If the allocation fails, a dummy do-nothing program
will replace to-be-detached program in-place.

Signed-off-by: Yonghong Song &lt;yhs@fb.com&gt;
Acked-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Martin KaFai Lau &lt;kafai@fb.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
(cherry picked from commit e87c6bc3852b981e71c757be20771546ce9f76f3)
Signed-off-by: Connor O'Brien &lt;connoro@google.com&gt;
Bug: 121213201
Bug: 138317270
Test: build &amp; boot cuttlefish; attach 2 progs to 1 tracepoint
Change-Id: I390d8c0146888ddb1aed5a6f6e5dae7ef394ebc9
Signed-off-by: Chatur27 &lt;jasonbright2709@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>perf, bpf: minimize the size of perf_trace_() tracepoint handler</title>
<updated>2022-04-18T21:51:32+00:00</updated>
<author>
<name>Alexei Starovoitov</name>
<email>ast@fb.com</email>
</author>
<published>2016-04-19T03:11:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.compromyse.xyz/android/android_kernel_zuk_msm8996.git/commit/?id=3f79f14b62202045de323c754352cee2ac3b1d08'/>
<id>3f79f14b62202045de323c754352cee2ac3b1d08</id>
<content type='text'>
move trace_call_bpf() into helper function to minimize the size
of perf_trace_*() tracepoint handlers.
    text	   data	    bss	    dec	 	   hex	filename
10541679	5526646	2945024	19013349	1221ee5	vmlinux_before
10509422	5526646	2945024	18981092	121a0e4	vmlinux_after

It may seem that perf_fetch_caller_regs() can also be moved,
but that is incorrect, since ip/sp will be wrong.

bpf+tracepoint performance is not affected, since
perf_swevent_put_recursion_context() is now inlined.
export_symbol_gpl can also be dropped.

No measurable change in normal perf tracepoints.

Suggested-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Acked-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Chatur27 &lt;jasonbright2709@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
move trace_call_bpf() into helper function to minimize the size
of perf_trace_*() tracepoint handlers.
    text	   data	    bss	    dec	 	   hex	filename
10541679	5526646	2945024	19013349	1221ee5	vmlinux_before
10509422	5526646	2945024	18981092	121a0e4	vmlinux_after

It may seem that perf_fetch_caller_regs() can also be moved,
but that is incorrect, since ip/sp will be wrong.

bpf+tracepoint performance is not affected, since
perf_swevent_put_recursion_context() is now inlined.
export_symbol_gpl can also be dropped.

No measurable change in normal perf tracepoints.

Suggested-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Acked-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Chatur27 &lt;jasonbright2709@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>perf, bpf: allow bpf programs attach to tracepoints</title>
<updated>2022-04-18T21:50:03+00:00</updated>
<author>
<name>Alexei Starovoitov</name>
<email>ast@fb.com</email>
</author>
<published>2016-04-07T01:43:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.compromyse.xyz/android/android_kernel_zuk_msm8996.git/commit/?id=c31b29c9f8bcddeb6cb5630c00da681c0186d6c1'/>
<id>c31b29c9f8bcddeb6cb5630c00da681c0186d6c1</id>
<content type='text'>
introduce BPF_PROG_TYPE_TRACEPOINT program type and allow it to be attached
to the perf tracepoint handler, which will copy the arguments into
the per-cpu buffer and pass it to the bpf program as its first argument.
The layout of the fields can be discovered by doing
'cat /sys/kernel/debug/tracing/events/sched/sched_switch/format'
prior to the compilation of the program with exception that first 8 bytes
are reserved and not accessible to the program. This area is used to store
the pointer to 'struct pt_regs' which some of the bpf helpers will use:
+---------+
| 8 bytes | hidden 'struct pt_regs *' (inaccessible to bpf program)
+---------+
| N bytes | static tracepoint fields defined in tracepoint/format (bpf readonly)
+---------+
| dynamic | __dynamic_array bytes of tracepoint (inaccessible to bpf yet)
+---------+

Not that all of the fields are already dumped to user space via perf ring buffer
and broken application access it directly without consulting tracepoint/format.
Same rule applies here: static tracepoint fields should only be accessed
in a format defined in tracepoint/format. The order of fields and
field sizes are not an ABI.

Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Chatur27 &lt;jasonbright2709@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
introduce BPF_PROG_TYPE_TRACEPOINT program type and allow it to be attached
to the perf tracepoint handler, which will copy the arguments into
the per-cpu buffer and pass it to the bpf program as its first argument.
The layout of the fields can be discovered by doing
'cat /sys/kernel/debug/tracing/events/sched/sched_switch/format'
prior to the compilation of the program with exception that first 8 bytes
are reserved and not accessible to the program. This area is used to store
the pointer to 'struct pt_regs' which some of the bpf helpers will use:
+---------+
| 8 bytes | hidden 'struct pt_regs *' (inaccessible to bpf program)
+---------+
| N bytes | static tracepoint fields defined in tracepoint/format (bpf readonly)
+---------+
| dynamic | __dynamic_array bytes of tracepoint (inaccessible to bpf yet)
+---------+

Not that all of the fields are already dumped to user space via perf ring buffer
and broken application access it directly without consulting tracepoint/format.
Same rule applies here: static tracepoint fields should only be accessed
in a format defined in tracepoint/format. The order of fields and
field sizes are not an ABI.

Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Chatur27 &lt;jasonbright2709@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>perf: split perf_trace_buf_prepare into alloc and update parts</title>
<updated>2022-04-18T21:50:03+00:00</updated>
<author>
<name>Alexei Starovoitov</name>
<email>ast@fb.com</email>
</author>
<published>2016-04-07T01:43:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.compromyse.xyz/android/android_kernel_zuk_msm8996.git/commit/?id=538fc7a1e7a31858f9b43afa4805378502d47054'/>
<id>538fc7a1e7a31858f9b43afa4805378502d47054</id>
<content type='text'>
split allows to move expensive update of 'struct trace_entry' to later phase.
Repurpose unused 1st argument of perf_tp_event() to indicate event type.

While splitting use temp variable 'rctx' instead of '*rctx' to avoid
unnecessary loads done by the compiler due to -fno-strict-aliasing

Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Chatur27 &lt;jasonbright2709@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
split allows to move expensive update of 'struct trace_entry' to later phase.
Repurpose unused 1st argument of perf_tp_event() to indicate event type.

While splitting use temp variable 'rctx' instead of '*rctx' to avoid
unnecessary loads done by the compiler due to -fno-strict-aliasing

Signed-off-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Chatur27 &lt;jasonbright2709@gmail.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
