lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Tue, 14 Jan 2014 08:38:39 -0800
From:	tip-bot for Arnaldo Carvalho de Melo <tipbot@...or.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org, eranian@...gle.com, paulus@...ba.org,
	acme@...hat.com, hpa@...or.com, mingo@...nel.org,
	peterz@...radead.org, efault@....de, namhyung@...nel.org,
	jolsa@...hat.com, fweisbec@...il.com, adrian.hunter@...el.com,
	dsahern@...il.com, tglx@...utronix.de
Subject: [tip:perf/core] perf header: Pack 'struct perf_session_env'

Commit-ID:  3ba4d2e1a8235d862657ded9f20b3170b477768b
Gitweb:     http://git.kernel.org/tip/3ba4d2e1a8235d862657ded9f20b3170b477768b
Author:     Arnaldo Carvalho de Melo <acme@...hat.com>
AuthorDate: Mon, 6 Jan 2014 15:28:35 -0300
Committer:  Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Mon, 13 Jan 2014 10:06:23 -0300

perf header: Pack 'struct perf_session_env'

Initial struct:

[acme@...andy linux]$ pahole -C perf_session_env ~/bin/perf
struct perf_session_env {
	char *                     hostname;             /*     0     8 */
	char *                     os_release;           /*     8     8 */
	char *                     version;              /*    16     8 */
	char *                     arch;                 /*    24     8 */
	int                        nr_cpus_online;       /*    32     4 */
	int                        nr_cpus_avail;        /*    36     4 */
	char *                     cpu_desc;             /*    40     8 */
	char *                     cpuid;                /*    48     8 */
	long long unsigned int     total_mem;            /*    56     8 */
	/* --- cacheline 1 boundary (64 bytes) --- */
	int                        nr_cmdline;           /*    64     4 */

	/* XXX 4 bytes hole, try to pack */

	char *                     cmdline;              /*    72     8 */
	int                        nr_sibling_cores;     /*    80     4 */

	/* XXX 4 bytes hole, try to pack */

	char *                     sibling_cores;        /*    88     8 */
	int                        nr_sibling_threads;   /*    96     4 */

	/* XXX 4 bytes hole, try to pack */

	char *                     sibling_threads;      /*   104     8 */
	int                        nr_numa_nodes;        /*   112     4 */

	/* XXX 4 bytes hole, try to pack */

	char *                     numa_nodes;           /*   120     8 */
	/* --- cacheline 2 boundary (128 bytes) --- */
	int                        nr_pmu_mappings;      /*   128     4 */

	/* XXX 4 bytes hole, try to pack */

	char *                     pmu_mappings;         /*   136     8 */
	int                        nr_groups;            /*   144     4 */

	/* size: 152, cachelines: 3, members: 20 */
	/* sum members: 128, holes: 5, sum holes: 20 */
	/* padding: 4 */
	/* last cacheline: 24 bytes */
};
[acme@...andy linux]$

[acme@...andy linux]$ pahole -C perf_session_env --reorganize --show_reorg_steps ~/bin/perf | grep ^/ | grep -v Final
/* Moving 'nr_sibling_cores' from after 'cmdline' to after 'nr_cmdline' */
/* Moving 'nr_numa_nodes' from after 'sibling_threads' to after 'nr_sibling_threads' */
/* Moving 'nr_groups' from after 'pmu_mappings' to after 'nr_pmu_mappings' */
[acme@...andy linux]$

Final struct stats:

[acme@...andy linux]$ pahole -C perf_session_env --reorganize --show_reorg_steps ~/bin/perf | tail -4
	/* --- cacheline 2 boundary (128 bytes) --- */

	/* size: 128, cachelines: 2, members: 20 */
};   /* saved 24 bytes and 1 cacheline! */
[acme@...andy linux]$

Cc: Adrian Hunter <adrian.hunter@...el.com>
Cc: David Ahern <dsahern@...il.com>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Mike Galbraith <efault@....de>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Stephane Eranian <eranian@...gle.com>
Link: http://lkml.kernel.org/n/tip-3d9tshamloinzxcqeb7mtd1n@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
 tools/perf/util/header.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/perf/util/header.h b/tools/perf/util/header.h
index 307c9ae..a2d047b 100644
--- a/tools/perf/util/header.h
+++ b/tools/perf/util/header.h
@@ -77,16 +77,16 @@ struct perf_session_env {
 	unsigned long long	total_mem;
 
 	int			nr_cmdline;
-	char			*cmdline;
 	int			nr_sibling_cores;
-	char			*sibling_cores;
 	int			nr_sibling_threads;
-	char			*sibling_threads;
 	int			nr_numa_nodes;
-	char			*numa_nodes;
 	int			nr_pmu_mappings;
-	char			*pmu_mappings;
 	int			nr_groups;
+	char			*cmdline;
+	char			*sibling_cores;
+	char			*sibling_threads;
+	char			*numa_nodes;
+	char			*pmu_mappings;
 };
 
 struct perf_header {
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ