From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Jiri Olsa <jolsa@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
Jiri Olsa <jolsa@kernel.org>,
linux-rt-users@vger.kernel.org,
Thomas Gleixner <tglx@linutronix.de>,
Juri Lelli <juri.lelli@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>
Subject: [PATCH RT v2] tracing: make preempt_lazy and migrate_disable counter smaller
Date: Mon, 24 Feb 2020 18:01:01 +0100 [thread overview]
Message-ID: <20200224170101.qvxapdecp5vsbwrw@linutronix.de> (raw)
In-Reply-To: <20200224115403.GD16664@krava>
The migrate_disable counter should not exceed 255 so it is enough to
store it in an 8bit field.
With this change we can move the `preempt_lazy_count' member into the
gap so the whole struct shrinks by 4 bytes to 12 bytes in total.
Remove the `padding' field, it is not needed.
Update the tracing fields in trace_define_common_fields() (it was
missing the preempt_lazy_count field).
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
v1…v2:
- drop the `padding' member
- update the members in trace_define_common_fields() to match struct
trace_entry.
include/linux/trace_events.h | 3 +--
kernel/trace/trace_events.c | 4 ++--
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h
index f3b1ef07e4a5f..10bbf986bc1d5 100644
--- a/include/linux/trace_events.h
+++ b/include/linux/trace_events.h
@@ -62,8 +62,7 @@ struct trace_entry {
unsigned char flags;
unsigned char preempt_count;
int pid;
- unsigned short migrate_disable;
- unsigned short padding;
+ unsigned char migrate_disable;
unsigned char preempt_lazy_count;
};
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index accaae59a7626..8bfb187cce65a 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -181,8 +181,8 @@ static int trace_define_common_fields(void)
__common_field(unsigned char, flags);
__common_field(unsigned char, preempt_count);
__common_field(int, pid);
- __common_field(unsigned short, migrate_disable);
- __common_field(unsigned short, padding);
+ __common_field(unsigned char, migrate_disable);
+ __common_field(unsigned char, preempt_lazy_count);
return ret;
}
--
2.25.1
next prev parent reply other threads:[~2020-02-24 17:01 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-21 15:35 [PATCH] tracing: Fix trace entry and trace common fields for preempt_lazy_count Jiri Olsa
2020-02-21 15:49 ` Steven Rostedt
2020-02-21 16:10 ` Jiri Olsa
2020-02-21 16:21 ` Steven Rostedt
2020-02-21 16:29 ` Jiri Olsa
2020-02-21 16:50 ` Steven Rostedt
2020-02-21 16:37 ` Sebastian Andrzej Siewior
2020-02-21 17:44 ` [PATCH RT] tracing: make preempt_lazy and migrate_disable counter smaller Sebastian Andrzej Siewior
2020-02-21 19:51 ` Steven Rostedt
2020-02-21 20:20 ` Sebastian Andrzej Siewior
2020-02-21 20:49 ` Jiri Olsa
2020-02-24 10:01 ` Sebastian Andrzej Siewior
2020-02-24 11:54 ` Jiri Olsa
2020-02-24 17:01 ` Sebastian Andrzej Siewior [this message]
2020-03-09 12:30 ` [PATCH RT v2] " Jiri Olsa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200224170101.qvxapdecp5vsbwrw@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=acme@kernel.org \
--cc=jolsa@kernel.org \
--cc=jolsa@redhat.com \
--cc=juri.lelli@redhat.com \
--cc=linux-rt-users@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).