From: George Dunlap <george.dunlap@eu.citrix.com>
To: Roger Pau Monne <roger.pau@citrix.com>, xen-devel@lists.xenproject.org
Cc: Wei Liu <wei.liu2@citrix.com>, Olaf Hering <olaf@aepfle.de>,
Ian Jackson <ian.jackson@eu.citrix.com>,
Ian Campbell <ian.campbell@citrix.com>
Subject: Re: [PATCH 1/2] xen{trace/analyze}: don't use 64bit versions of libc functions
Date: Mon, 22 Jun 2015 10:08:36 +0100 [thread overview]
Message-ID: <5587D094.9030304@eu.citrix.com> (raw)
In-Reply-To: <1434704305-64692-2-git-send-email-roger.pau@citrix.com>
On 06/19/2015 09:58 AM, Roger Pau Monne wrote:
> This is not needed, neither encouraged. Configure already checks
> _FILE_OFFSET_BITS and appends it when needed, so that the right functions
> are used. Also remove the usage of loff_t and O_LARGEFILE for the same
> reason.
Just so I understand -- are you saying that configure at the tools
directory level will notice that Linux can handle 64-bit file operations
and use them automatically?
-George
>
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> Cc: George Dunlap <george.dunlap@eu.citrix.com>
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Ian Campbell <ian.campbell@citrix.com>
> Cc: Wei Liu <wei.liu2@citrix.com>
> Cc: Olaf Hering <olaf@aepfle.de>
> ---
> tools/xentrace/mread.c | 8 ++++----
> tools/xentrace/mread.h | 6 +++---
> tools/xentrace/xenalyze.c | 28 ++++++++++++++--------------
> 3 files changed, 21 insertions(+), 21 deletions(-)
>
> diff --git a/tools/xentrace/mread.c b/tools/xentrace/mread.c
> index a63d16c..a22c4ea 100644
> --- a/tools/xentrace/mread.c
> +++ b/tools/xentrace/mread.c
> @@ -9,7 +9,7 @@
>
> mread_handle_t mread_init(int fd)
> {
> - struct stat64 s;
> + struct stat s;
> mread_handle_t h;
>
> h=malloc(sizeof(struct mread_ctrl));
> @@ -24,13 +24,13 @@ mread_handle_t mread_init(int fd)
>
> h->fd = fd;
>
> - fstat64(fd, &s);
> + fstat(fd, &s);
> h->file_size = s.st_size;
>
> return h;
> }
>
> -ssize_t mread64(mread_handle_t h, void *rec, ssize_t len, loff_t offset)
> +ssize_t mread64(mread_handle_t h, void *rec, ssize_t len, off_t offset)
> {
> /* Idea: have a "cache" of N mmaped regions. If the offset is
> * in one of the regions, just copy it. If not, evict one of the
> @@ -45,7 +45,7 @@ ssize_t mread64(mread_handle_t h, void *rec, ssize_t len, loff_t offset)
> */
> char * b=NULL;
> int bind=-1;
> - loff_t boffset=0;
> + off_t boffset=0;
> ssize_t bsize;
>
> #define dprintf(x...)
> diff --git a/tools/xentrace/mread.h b/tools/xentrace/mread.h
> index 8df41a8..443814f 100644
> --- a/tools/xentrace/mread.h
> +++ b/tools/xentrace/mread.h
> @@ -5,14 +5,14 @@
> #define MREAD_BUF_MASK (~(MREAD_BUF_SIZE-1))
> typedef struct mread_ctrl {
> int fd;
> - loff_t file_size;
> + off_t file_size;
> struct mread_buffer {
> char * buffer;
> - loff_t start_offset;
> + off_t start_offset;
> int accessed;
> } map[MREAD_MAPS];
> int clock, last;
> } *mread_handle_t;
>
> mread_handle_t mread_init(int fd);
> -ssize_t mread64(mread_handle_t h, void *dst, ssize_t len, loff_t offset);
> +ssize_t mread64(mread_handle_t h, void *dst, ssize_t len, off_t offset);
> diff --git a/tools/xentrace/xenalyze.c b/tools/xentrace/xenalyze.c
> index a8e73eb..dc89ffe 100644
> --- a/tools/xentrace/xenalyze.c
> +++ b/tools/xentrace/xenalyze.c
> @@ -70,9 +70,9 @@ struct {
> char * symbol_file;
> char * trace_file;
> int output_defined;
> - loff_t file_size;
> + off_t file_size;
> struct {
> - loff_t update_offset;
> + off_t update_offset;
> int pipe[2];
> FILE* out;
> int pid;
> @@ -1853,8 +1853,8 @@ struct pcpu_info {
>
> /* Information related to scanning thru the file */
> tsc_t first_tsc, last_tsc, order_tsc;
> - loff_t file_offset;
> - loff_t next_cpu_change_offset;
> + off_t file_offset;
> + off_t next_cpu_change_offset;
> struct record_info ri;
> int last_cpu_change_pid;
> int power_state;
> @@ -1898,7 +1898,7 @@ void __fill_in_record_info(struct pcpu_info *p);
>
> struct {
> int max_active_pcpu;
> - loff_t last_epoch_offset;
> + off_t last_epoch_offset;
> int early_eof;
> int lost_cpus;
> tsc_t now;
> @@ -1937,7 +1937,7 @@ char * pcpu_string(int pcpu);
> void pcpu_string_draw(struct pcpu_info *p);
> void process_generic(struct record_info *ri);
> void dump_generic(FILE *f, struct record_info *ri);
> -ssize_t __read_record(struct trace_record *rec, loff_t offset);
> +ssize_t __read_record(struct trace_record *rec, off_t offset);
> void error(enum error_level l, struct record_info *ri);
> void update_io_address(struct io_address ** list, unsigned int pa, int dir,
> tsc_t arc_cycles, unsigned int va);
> @@ -8512,7 +8512,7 @@ void activate_early_eof(void) {
> }
> }
>
> -loff_t scan_for_new_pcpu(loff_t offset) {
> +off_t scan_for_new_pcpu(off_t offset) {
> ssize_t r;
> struct trace_record rec;
> struct cpu_change_data *cd;
> @@ -9051,7 +9051,7 @@ void progress_init(void) {
>
> }
>
> -void progress_update(loff_t offset) {
> +void progress_update(off_t offset) {
> long long p;
>
> p = ( offset * 100 ) / G.file_size;
> @@ -9089,7 +9089,7 @@ void progress_finish(void) {
> }
> }
>
> -ssize_t __read_record(struct trace_record *rec, loff_t offset)
> +ssize_t __read_record(struct trace_record *rec, off_t offset)
> {
> ssize_t r, rsize;
>
> @@ -9172,7 +9172,7 @@ void __fill_in_record_info(struct pcpu_info *p)
> }
>
> ssize_t read_record(struct pcpu_info * p) {
> - loff_t * offset;
> + off_t * offset;
> struct record_info *ri;
>
> offset = &p->file_offset;
> @@ -9489,7 +9489,7 @@ void report_pcpu(void) {
>
> void init_pcpus(void) {
> int i=0;
> - loff_t offset = 0;
> + off_t offset = 0;
>
> for(i=0; i<MAX_CPUS; i++)
> {
> @@ -10358,12 +10358,12 @@ int main(int argc, char *argv[]) {
> if (G.trace_file == NULL)
> exit(1);
>
> - if ( (G.fd = open(G.trace_file, O_RDONLY|O_LARGEFILE)) < 0) {
> + if ( (G.fd = open(G.trace_file, O_RDONLY)) < 0) {
> perror("open");
> error(ERR_SYSTEM, NULL);
> } else {
> - struct stat64 s;
> - fstat64(G.fd, &s);
> + struct stat s;
> + fstat(G.fd, &s);
> G.file_size = s.st_size;
> }
>
>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2015-06-22 9:09 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-19 8:58 [PATCH 0/2] xen{trace/analyze}: fix build on FreeBSD Roger Pau Monne
2015-06-19 8:58 ` [PATCH 1/2] xen{trace/analyze}: don't use 64bit versions of libc functions Roger Pau Monne
2015-06-19 13:07 ` Wei Liu
2015-06-22 9:08 ` George Dunlap [this message]
2015-06-22 9:59 ` Roger Pau Monné
2015-06-22 10:09 ` George Dunlap
2015-06-22 14:48 ` Roger Pau Monné
2015-06-24 11:11 ` Roger Pau Monné
2015-06-24 13:02 ` Roger Pau Monné
2015-06-24 13:08 ` George Dunlap
2015-06-19 8:58 ` [PATCH 2/2] configure: check for argp Roger Pau Monne
2015-06-19 13:10 ` Wei Liu
2015-06-22 10:12 ` George Dunlap
2015-06-22 10:45 ` Wei Liu
2015-06-22 10:55 ` George Dunlap
2015-06-22 11:10 ` Wei Liu
2015-06-22 11:13 ` George Dunlap
2015-06-25 12:01 ` [PATCH 0/2] xen{trace/analyze}: fix build on FreeBSD Ian Campbell
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=5587D094.9030304@eu.citrix.com \
--to=george.dunlap@eu.citrix.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=olaf@aepfle.de \
--cc=roger.pau@citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xenproject.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.