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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 16 Sep 2011 17:42:21 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	David Ahern <dsahern@...il.com>
Cc:	Stephane Eranian <eranian@...gle.com>,
	linux-kernel@...r.kernel.org, acme@...hat.com, mingo@...e.hu
Subject: Re: [PATCH] perf: make perf.data more self-descriptive (v4)

On Fri, 2011-09-16 at 09:33 -0600, David Ahern wrote:
> 
> On 09/16/2011 09:19 AM, Peter Zijlstra wrote:
> > On Fri, 2011-09-16 at 08:50 -0600, David Ahern wrote:
> >>
> >> ppc data file: header->magic 454c494646524550
> >> x86 data file: header->magic 454c494646524550
> >>
> > Ok then we need to fix that magic thing..
> 
> Right, but it breaks backwards/forwards compatibility. e.g.,
> 
> diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
> index 73fa59e..603a8bb9 100644
> --- a/tools/perf/util/header.c
> +++ b/tools/perf/util/header.c
> @@ -65,9 +65,7 @@ char *perf_header__find_event(u64 id)
>     return NULL;
>  }
> 
> -static const char *__perf_magic = "PERFFILE";
> -
> -#define PERF_MAGIC (*(u64 *)__perf_magic)
> +#define PERF_MAGIC 0x5045524646494c45ULL  // "PERFFILE"
> 
>  struct perf_file_attr {
>     struct perf_event_attr  attr;
> 
> That puts the magic in the file based on endianness of the recording
> system. e.g., on x86:
> 
> $ od -c perf-magic.data | head -1
> 0000000   E   L   I   F   F   R   E   P   h  \0  \0  \0  \0  \0  \0  \0
> 
> Which means older perf binaries can't analyze new files (created with
> new magic order) and newer perf binaries can't analyze older perf files
> -- the new command will incorrectly want to do endian swapping on the
> old file.

crap.. sounds like a nice moment to ditch the current format and go for
the multi-file setup.. :-)
--
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