xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] xen{trace/analyze}: fix build on FreeBSD
@ 2015-06-19  8:58 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
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Roger Pau Monne @ 2015-06-19  8:58 UTC (permalink / raw)
  To: xen-devel

Fix the build of xentrace/xenalyze on FreeBSD, and possibly other libcs not 
having argp. Also fix the usage of fstat64 and O_LARGEFILE.

Roger.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 1/2] xen{trace/analyze}: don't use 64bit versions of libc functions
  2015-06-19  8:58 [PATCH 0/2] xen{trace/analyze}: fix build on FreeBSD Roger Pau Monne
@ 2015-06-19  8:58 ` Roger Pau Monne
  2015-06-19 13:07   ` Wei Liu
  2015-06-22  9:08   ` George Dunlap
  2015-06-19  8:58 ` [PATCH 2/2] configure: check for argp Roger Pau Monne
  2015-06-25 12:01 ` [PATCH 0/2] xen{trace/analyze}: fix build on FreeBSD Ian Campbell
  2 siblings, 2 replies; 18+ messages in thread
From: Roger Pau Monne @ 2015-06-19  8:58 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, George Dunlap, Ian Jackson,
	Roger Pau Monne

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.

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;
     }
 
-- 
1.9.5 (Apple Git-50.3)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 2/2] configure: check for argp
  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  8:58 ` Roger Pau Monne
  2015-06-19 13:10   ` Wei Liu
  2015-06-22 10:12   ` George Dunlap
  2015-06-25 12:01 ` [PATCH 0/2] xen{trace/analyze}: fix build on FreeBSD Ian Campbell
  2 siblings, 2 replies; 18+ messages in thread
From: Roger Pau Monne @ 2015-06-19  8:58 UTC (permalink / raw)
  To: xen-devel
  Cc: Olaf Hering, Wei Liu, Ian Campbell, George Dunlap, Ian Jackson,
	Roger Pau Monne

argp is only present in the GNU C library, so add a specific check for it in
configure. Also check if -largp is needed for linking against it.

Please run autoconf after applying.

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>
---
 config/Tools.mk.in      | 1 +
 tools/configure.ac      | 4 ++++
 tools/xentrace/Makefile | 2 +-
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/config/Tools.mk.in b/config/Tools.mk.in
index aef9ed6..9bd5f6c 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -78,5 +78,6 @@ CONFIG_GCRYPT       := @libgcrypt@
 EXTFS_LIBS          := @EXTFS_LIBS@
 CURSES_LIBS         := @CURSES_LIBS@
 TINFO_LIBS          := @TINFO_LIBS@
+ARGP_LDFLAGS        := @argp_ldflags@
 
 FILE_OFFSET_BITS    := @FILE_OFFSET_BITS@
diff --git a/tools/configure.ac b/tools/configure.ac
index 1a06ddf..5eb4799 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -356,6 +356,10 @@ AC_CHECK_LIB([yajl], [yajl_alloc], [],
 AC_CHECK_LIB([z], [deflateCopy], [], [AC_MSG_ERROR([Could not find zlib])])
 AC_CHECK_LIB([iconv], [libiconv_open], [libiconv="y"], [libiconv="n"])
 AC_SUBST(libiconv)
+AC_CHECK_HEADER([argp.h], [
+AC_CHECK_LIB([argp], [argp_usage], [argp_ldflags="-largp"])
+], [AC_MSG_ERROR([Could not find argp])])
+AC_SUBST(argp_ldflags)
 
 # FDT is needed only on ARM
 case "$host_cpu" in
diff --git a/tools/xentrace/Makefile b/tools/xentrace/Makefile
index 7d874a3..2f57bda 100644
--- a/tools/xentrace/Makefile
+++ b/tools/xentrace/Makefile
@@ -4,7 +4,7 @@ include $(XEN_ROOT)/tools/Rules.mk
 CFLAGS += -Werror
 
 CFLAGS += $(CFLAGS_libxenctrl)
-LDLIBS += $(LDLIBS_libxenctrl)
+LDLIBS += $(LDLIBS_libxenctrl) $(ARGP_LDFLAGS)
 
 BIN-$(CONFIG_X86) = xenalyze
 BIN      = $(BIN-y)
-- 
1.9.5 (Apple Git-50.3)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH 1/2] xen{trace/analyze}: don't use 64bit versions of libc functions
  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
  1 sibling, 0 replies; 18+ messages in thread
From: Wei Liu @ 2015-06-19 13:07 UTC (permalink / raw)
  To: Roger Pau Monne
  Cc: Olaf Hering, Wei Liu, Ian Campbell, George Dunlap, Ian Jackson,
	xen-devel

On Fri, Jun 19, 2015 at 10:58:24AM +0200, 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.
> 
> 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>

Acked-by: Wei Liu <wei.liu2@citrix.com>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 2/2] configure: check for argp
  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
  1 sibling, 0 replies; 18+ messages in thread
From: Wei Liu @ 2015-06-19 13:10 UTC (permalink / raw)
  To: Roger Pau Monne
  Cc: Olaf Hering, Wei Liu, Ian Campbell, George Dunlap, Ian Jackson,
	xen-devel

On Fri, Jun 19, 2015 at 10:58:25AM +0200, Roger Pau Monne wrote:
> argp is only present in the GNU C library, so add a specific check for it in
> configure. Also check if -largp is needed for linking against it.
> 
> Please run autoconf after applying.
> 
> 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>

Acked-by: Wei Liu <wei.liu2@citrix.com>

> ---
>  config/Tools.mk.in      | 1 +
>  tools/configure.ac      | 4 ++++
>  tools/xentrace/Makefile | 2 +-
>  3 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/config/Tools.mk.in b/config/Tools.mk.in
> index aef9ed6..9bd5f6c 100644
> --- a/config/Tools.mk.in
> +++ b/config/Tools.mk.in
> @@ -78,5 +78,6 @@ CONFIG_GCRYPT       := @libgcrypt@
>  EXTFS_LIBS          := @EXTFS_LIBS@
>  CURSES_LIBS         := @CURSES_LIBS@
>  TINFO_LIBS          := @TINFO_LIBS@
> +ARGP_LDFLAGS        := @argp_ldflags@
>  
>  FILE_OFFSET_BITS    := @FILE_OFFSET_BITS@
> diff --git a/tools/configure.ac b/tools/configure.ac
> index 1a06ddf..5eb4799 100644
> --- a/tools/configure.ac
> +++ b/tools/configure.ac
> @@ -356,6 +356,10 @@ AC_CHECK_LIB([yajl], [yajl_alloc], [],
>  AC_CHECK_LIB([z], [deflateCopy], [], [AC_MSG_ERROR([Could not find zlib])])
>  AC_CHECK_LIB([iconv], [libiconv_open], [libiconv="y"], [libiconv="n"])
>  AC_SUBST(libiconv)
> +AC_CHECK_HEADER([argp.h], [
> +AC_CHECK_LIB([argp], [argp_usage], [argp_ldflags="-largp"])
> +], [AC_MSG_ERROR([Could not find argp])])
> +AC_SUBST(argp_ldflags)
>  
>  # FDT is needed only on ARM
>  case "$host_cpu" in
> diff --git a/tools/xentrace/Makefile b/tools/xentrace/Makefile
> index 7d874a3..2f57bda 100644
> --- a/tools/xentrace/Makefile
> +++ b/tools/xentrace/Makefile
> @@ -4,7 +4,7 @@ include $(XEN_ROOT)/tools/Rules.mk
>  CFLAGS += -Werror
>  
>  CFLAGS += $(CFLAGS_libxenctrl)
> -LDLIBS += $(LDLIBS_libxenctrl)
> +LDLIBS += $(LDLIBS_libxenctrl) $(ARGP_LDFLAGS)
>  
>  BIN-$(CONFIG_X86) = xenalyze
>  BIN      = $(BIN-y)
> -- 
> 1.9.5 (Apple Git-50.3)

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 1/2] xen{trace/analyze}: don't use 64bit versions of libc functions
  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
  2015-06-22  9:59     ` Roger Pau Monné
  1 sibling, 1 reply; 18+ messages in thread
From: George Dunlap @ 2015-06-22  9:08 UTC (permalink / raw)
  To: Roger Pau Monne, xen-devel
  Cc: Wei Liu, Olaf Hering, Ian Jackson, Ian Campbell

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

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 1/2] xen{trace/analyze}: don't use 64bit versions of libc functions
  2015-06-22  9:08   ` George Dunlap
@ 2015-06-22  9:59     ` Roger Pau Monné
  2015-06-22 10:09       ` George Dunlap
  0 siblings, 1 reply; 18+ messages in thread
From: Roger Pau Monné @ 2015-06-22  9:59 UTC (permalink / raw)
  To: George Dunlap, xen-devel; +Cc: Wei Liu, Olaf Hering, Ian Jackson, Ian Campbell

El 22/06/15 a les 11.08, George Dunlap ha escrit:
> 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?

Yes, according to the man page [1]:

"Over time, increases in the size of the stat structure have led to
three successive versions of stat(): sys_stat() (slot __NR_oldstat),
sys_newstat() (slot __NR_stat), and sys_stat64() (new in kernel 2.4;
slot __NR_stat64). The glibc stat() wrapper function hides these details
from applications, invoking the most recent version of the system call
provided by the kernel, and repacking the returned information if
required for old binaries. Similar remarks apply for fstat() and lstat()."

Roger.

[1] http://linux.die.net/man/2/fstat64

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 1/2] xen{trace/analyze}: don't use 64bit versions of libc functions
  2015-06-22  9:59     ` Roger Pau Monné
@ 2015-06-22 10:09       ` George Dunlap
  2015-06-22 14:48         ` Roger Pau Monné
  0 siblings, 1 reply; 18+ messages in thread
From: George Dunlap @ 2015-06-22 10:09 UTC (permalink / raw)
  To: Roger Pau Monné, xen-devel
  Cc: Wei Liu, Olaf Hering, Ian Jackson, Ian Campbell

On 06/22/2015 10:59 AM, Roger Pau Monné wrote:
> El 22/06/15 a les 11.08, George Dunlap ha escrit:
>> 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?
> 
> Yes, according to the man page [1]:
> 
> "Over time, increases in the size of the stat structure have led to
> three successive versions of stat(): sys_stat() (slot __NR_oldstat),
> sys_newstat() (slot __NR_stat), and sys_stat64() (new in kernel 2.4;
> slot __NR_stat64). The glibc stat() wrapper function hides these details
> from applications, invoking the most recent version of the system call
> provided by the kernel, and repacking the returned information if
> required for old binaries. Similar remarks apply for fstat() and lstat()."

OK, if you can confirm that you've actually tested this on a file larger
than 4GiB, then:

Acked-by: George Dunlap <george.dunlap@eu.citrix.com>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 2/2] configure: check for argp
  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
  1 sibling, 1 reply; 18+ messages in thread
From: George Dunlap @ 2015-06-22 10:12 UTC (permalink / raw)
  To: Roger Pau Monne, xen-devel
  Cc: Wei Liu, Olaf Hering, Ian Jackson, Ian Campbell

On 06/19/2015 09:58 AM, Roger Pau Monne wrote:
> argp is only present in the GNU C library, so add a specific check for it in
> configure. Also check if -largp is needed for linking against it.
> 
> Please run autoconf after applying.
> 
> 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>
> ---
>  config/Tools.mk.in      | 1 +
>  tools/configure.ac      | 4 ++++
>  tools/xentrace/Makefile | 2 +-
>  3 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/config/Tools.mk.in b/config/Tools.mk.in
> index aef9ed6..9bd5f6c 100644
> --- a/config/Tools.mk.in
> +++ b/config/Tools.mk.in
> @@ -78,5 +78,6 @@ CONFIG_GCRYPT       := @libgcrypt@
>  EXTFS_LIBS          := @EXTFS_LIBS@
>  CURSES_LIBS         := @CURSES_LIBS@
>  TINFO_LIBS          := @TINFO_LIBS@
> +ARGP_LDFLAGS        := @argp_ldflags@
>  
>  FILE_OFFSET_BITS    := @FILE_OFFSET_BITS@
> diff --git a/tools/configure.ac b/tools/configure.ac
> index 1a06ddf..5eb4799 100644
> --- a/tools/configure.ac
> +++ b/tools/configure.ac
> @@ -356,6 +356,10 @@ AC_CHECK_LIB([yajl], [yajl_alloc], [],
>  AC_CHECK_LIB([z], [deflateCopy], [], [AC_MSG_ERROR([Could not find zlib])])
>  AC_CHECK_LIB([iconv], [libiconv_open], [libiconv="y"], [libiconv="n"])
>  AC_SUBST(libiconv)
> +AC_CHECK_HEADER([argp.h], [
> +AC_CHECK_LIB([argp], [argp_usage], [argp_ldflags="-largp"])
> +], [AC_MSG_ERROR([Could not find argp])])
> +AC_SUBST(argp_ldflags)

Sorry if my config-fu isn't very good:  Is this basically requiring the
user to have argp available at configure time?  Does this make it more
difficult to build on BSDs?  Or is it just a matter of adding one more
library to the already long list of dependencies?

 -George


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 2/2] configure: check for argp
  2015-06-22 10:12   ` George Dunlap
@ 2015-06-22 10:45     ` Wei Liu
  2015-06-22 10:55       ` George Dunlap
  0 siblings, 1 reply; 18+ messages in thread
From: Wei Liu @ 2015-06-22 10:45 UTC (permalink / raw)
  To: George Dunlap
  Cc: Olaf Hering, Wei Liu, Ian Campbell, Ian Jackson, xen-devel,
	Roger Pau Monne

On Mon, Jun 22, 2015 at 11:12:27AM +0100, George Dunlap wrote:
> On 06/19/2015 09:58 AM, Roger Pau Monne wrote:
> > argp is only present in the GNU C library, so add a specific check for it in
> > configure. Also check if -largp is needed for linking against it.
> > 
> > Please run autoconf after applying.
> > 
> > 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>
> > ---
> >  config/Tools.mk.in      | 1 +
> >  tools/configure.ac      | 4 ++++
> >  tools/xentrace/Makefile | 2 +-
> >  3 files changed, 6 insertions(+), 1 deletion(-)
> > 
> > diff --git a/config/Tools.mk.in b/config/Tools.mk.in
> > index aef9ed6..9bd5f6c 100644
> > --- a/config/Tools.mk.in
> > +++ b/config/Tools.mk.in
> > @@ -78,5 +78,6 @@ CONFIG_GCRYPT       := @libgcrypt@
> >  EXTFS_LIBS          := @EXTFS_LIBS@
> >  CURSES_LIBS         := @CURSES_LIBS@
> >  TINFO_LIBS          := @TINFO_LIBS@
> > +ARGP_LDFLAGS        := @argp_ldflags@
> >  
> >  FILE_OFFSET_BITS    := @FILE_OFFSET_BITS@
> > diff --git a/tools/configure.ac b/tools/configure.ac
> > index 1a06ddf..5eb4799 100644
> > --- a/tools/configure.ac
> > +++ b/tools/configure.ac
> > @@ -356,6 +356,10 @@ AC_CHECK_LIB([yajl], [yajl_alloc], [],
> >  AC_CHECK_LIB([z], [deflateCopy], [], [AC_MSG_ERROR([Could not find zlib])])
> >  AC_CHECK_LIB([iconv], [libiconv_open], [libiconv="y"], [libiconv="n"])
> >  AC_SUBST(libiconv)
> > +AC_CHECK_HEADER([argp.h], [
> > +AC_CHECK_LIB([argp], [argp_usage], [argp_ldflags="-largp"])
> > +], [AC_MSG_ERROR([Could not find argp])])
> > +AC_SUBST(argp_ldflags)
> 
> Sorry if my config-fu isn't very good:  Is this basically requiring the
> user to have argp available at configure time?  Does this make it more
> difficult to build on BSDs?  Or is it just a matter of adding one more
> library to the already long list of dependencies?

This is just to make that dependency explicit. This is a step towards
the right direction.  It's not going to make it easier or harder to
build on BSDs.

Wei.

> 
>  -George

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 2/2] configure: check for argp
  2015-06-22 10:45     ` Wei Liu
@ 2015-06-22 10:55       ` George Dunlap
  2015-06-22 11:10         ` Wei Liu
  0 siblings, 1 reply; 18+ messages in thread
From: George Dunlap @ 2015-06-22 10:55 UTC (permalink / raw)
  To: Wei Liu
  Cc: xen-devel, Olaf Hering, Ian Jackson, Ian Campbell, Roger Pau Monne

On 06/22/2015 11:45 AM, Wei Liu wrote:
> On Mon, Jun 22, 2015 at 11:12:27AM +0100, George Dunlap wrote:
>> On 06/19/2015 09:58 AM, Roger Pau Monne wrote:
>>> argp is only present in the GNU C library, so add a specific check for it in
>>> configure. Also check if -largp is needed for linking against it.
>>>
>>> Please run autoconf after applying.
>>>
>>> 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>
>>> ---
>>>  config/Tools.mk.in      | 1 +
>>>  tools/configure.ac      | 4 ++++
>>>  tools/xentrace/Makefile | 2 +-
>>>  3 files changed, 6 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/config/Tools.mk.in b/config/Tools.mk.in
>>> index aef9ed6..9bd5f6c 100644
>>> --- a/config/Tools.mk.in
>>> +++ b/config/Tools.mk.in
>>> @@ -78,5 +78,6 @@ CONFIG_GCRYPT       := @libgcrypt@
>>>  EXTFS_LIBS          := @EXTFS_LIBS@
>>>  CURSES_LIBS         := @CURSES_LIBS@
>>>  TINFO_LIBS          := @TINFO_LIBS@
>>> +ARGP_LDFLAGS        := @argp_ldflags@
>>>  
>>>  FILE_OFFSET_BITS    := @FILE_OFFSET_BITS@
>>> diff --git a/tools/configure.ac b/tools/configure.ac
>>> index 1a06ddf..5eb4799 100644
>>> --- a/tools/configure.ac
>>> +++ b/tools/configure.ac
>>> @@ -356,6 +356,10 @@ AC_CHECK_LIB([yajl], [yajl_alloc], [],
>>>  AC_CHECK_LIB([z], [deflateCopy], [], [AC_MSG_ERROR([Could not find zlib])])
>>>  AC_CHECK_LIB([iconv], [libiconv_open], [libiconv="y"], [libiconv="n"])
>>>  AC_SUBST(libiconv)
>>> +AC_CHECK_HEADER([argp.h], [
>>> +AC_CHECK_LIB([argp], [argp_usage], [argp_ldflags="-largp"])
>>> +], [AC_MSG_ERROR([Could not find argp])])
>>> +AC_SUBST(argp_ldflags)
>>
>> Sorry if my config-fu isn't very good:  Is this basically requiring the
>> user to have argp available at configure time?  Does this make it more
>> difficult to build on BSDs?  Or is it just a matter of adding one more
>> library to the already long list of dependencies?
> 
> This is just to make that dependency explicit. This is a step towards
> the right direction.  It's not going to make it easier or harder to
> build on BSDs.

Well the reason I was asking is that if it would be a big hassle for
someone building on BSDs to install the argp library, then a better
option might to just not build xenalyze.

On the other hand, if it's no more difficult than installing libyajl (or
any of the other dozen dependencies), then adding a dependency is fine.
 And naturally in that case making the dependency explicit is the right
thing to do.

 -George

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 2/2] configure: check for argp
  2015-06-22 10:55       ` George Dunlap
@ 2015-06-22 11:10         ` Wei Liu
  2015-06-22 11:13           ` George Dunlap
  0 siblings, 1 reply; 18+ messages in thread
From: Wei Liu @ 2015-06-22 11:10 UTC (permalink / raw)
  To: George Dunlap
  Cc: Olaf Hering, Wei Liu, Ian Campbell, Ian Jackson, xen-devel,
	Roger Pau Monne

On Mon, Jun 22, 2015 at 11:55:44AM +0100, George Dunlap wrote:
> On 06/22/2015 11:45 AM, Wei Liu wrote:
> > On Mon, Jun 22, 2015 at 11:12:27AM +0100, George Dunlap wrote:
> >> On 06/19/2015 09:58 AM, Roger Pau Monne wrote:
> >>> argp is only present in the GNU C library, so add a specific check for it in
> >>> configure. Also check if -largp is needed for linking against it.
> >>>
> >>> Please run autoconf after applying.
> >>>
> >>> 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>
> >>> ---
> >>>  config/Tools.mk.in      | 1 +
> >>>  tools/configure.ac      | 4 ++++
> >>>  tools/xentrace/Makefile | 2 +-
> >>>  3 files changed, 6 insertions(+), 1 deletion(-)
> >>>
> >>> diff --git a/config/Tools.mk.in b/config/Tools.mk.in
> >>> index aef9ed6..9bd5f6c 100644
> >>> --- a/config/Tools.mk.in
> >>> +++ b/config/Tools.mk.in
> >>> @@ -78,5 +78,6 @@ CONFIG_GCRYPT       := @libgcrypt@
> >>>  EXTFS_LIBS          := @EXTFS_LIBS@
> >>>  CURSES_LIBS         := @CURSES_LIBS@
> >>>  TINFO_LIBS          := @TINFO_LIBS@
> >>> +ARGP_LDFLAGS        := @argp_ldflags@
> >>>  
> >>>  FILE_OFFSET_BITS    := @FILE_OFFSET_BITS@
> >>> diff --git a/tools/configure.ac b/tools/configure.ac
> >>> index 1a06ddf..5eb4799 100644
> >>> --- a/tools/configure.ac
> >>> +++ b/tools/configure.ac
> >>> @@ -356,6 +356,10 @@ AC_CHECK_LIB([yajl], [yajl_alloc], [],
> >>>  AC_CHECK_LIB([z], [deflateCopy], [], [AC_MSG_ERROR([Could not find zlib])])
> >>>  AC_CHECK_LIB([iconv], [libiconv_open], [libiconv="y"], [libiconv="n"])
> >>>  AC_SUBST(libiconv)
> >>> +AC_CHECK_HEADER([argp.h], [
> >>> +AC_CHECK_LIB([argp], [argp_usage], [argp_ldflags="-largp"])
> >>> +], [AC_MSG_ERROR([Could not find argp])])
> >>> +AC_SUBST(argp_ldflags)
> >>
> >> Sorry if my config-fu isn't very good:  Is this basically requiring the
> >> user to have argp available at configure time?  Does this make it more
> >> difficult to build on BSDs?  Or is it just a matter of adding one more
> >> library to the already long list of dependencies?
> > 
> > This is just to make that dependency explicit. This is a step towards
> > the right direction.  It's not going to make it easier or harder to
> > build on BSDs.
> 
> Well the reason I was asking is that if it would be a big hassle for
> someone building on BSDs to install the argp library, then a better
> option might to just not build xenalyze.
> 
> On the other hand, if it's no more difficult than installing libyajl (or
> any of the other dozen dependencies), then adding a dependency is fine.
>  And naturally in that case making the dependency explicit is the right
> thing to do.
> 

Yes, package argp exist in FreeBSD and NetBSD.

Wei.

>  -George
> 

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 2/2] configure: check for argp
  2015-06-22 11:10         ` Wei Liu
@ 2015-06-22 11:13           ` George Dunlap
  0 siblings, 0 replies; 18+ messages in thread
From: George Dunlap @ 2015-06-22 11:13 UTC (permalink / raw)
  To: Wei Liu
  Cc: xen-devel, Olaf Hering, Ian Jackson, Ian Campbell, Roger Pau Monne

On 06/22/2015 12:10 PM, Wei Liu wrote:
> On Mon, Jun 22, 2015 at 11:55:44AM +0100, George Dunlap wrote:
>> On 06/22/2015 11:45 AM, Wei Liu wrote:
>>> On Mon, Jun 22, 2015 at 11:12:27AM +0100, George Dunlap wrote:
>>>> On 06/19/2015 09:58 AM, Roger Pau Monne wrote:
>>>>> argp is only present in the GNU C library, so add a specific check for it in
>>>>> configure. Also check if -largp is needed for linking against it.
>>>>>
>>>>> Please run autoconf after applying.
>>>>>
>>>>> 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>
>>>>> ---
>>>>>  config/Tools.mk.in      | 1 +
>>>>>  tools/configure.ac      | 4 ++++
>>>>>  tools/xentrace/Makefile | 2 +-
>>>>>  3 files changed, 6 insertions(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/config/Tools.mk.in b/config/Tools.mk.in
>>>>> index aef9ed6..9bd5f6c 100644
>>>>> --- a/config/Tools.mk.in
>>>>> +++ b/config/Tools.mk.in
>>>>> @@ -78,5 +78,6 @@ CONFIG_GCRYPT       := @libgcrypt@
>>>>>  EXTFS_LIBS          := @EXTFS_LIBS@
>>>>>  CURSES_LIBS         := @CURSES_LIBS@
>>>>>  TINFO_LIBS          := @TINFO_LIBS@
>>>>> +ARGP_LDFLAGS        := @argp_ldflags@
>>>>>  
>>>>>  FILE_OFFSET_BITS    := @FILE_OFFSET_BITS@
>>>>> diff --git a/tools/configure.ac b/tools/configure.ac
>>>>> index 1a06ddf..5eb4799 100644
>>>>> --- a/tools/configure.ac
>>>>> +++ b/tools/configure.ac
>>>>> @@ -356,6 +356,10 @@ AC_CHECK_LIB([yajl], [yajl_alloc], [],
>>>>>  AC_CHECK_LIB([z], [deflateCopy], [], [AC_MSG_ERROR([Could not find zlib])])
>>>>>  AC_CHECK_LIB([iconv], [libiconv_open], [libiconv="y"], [libiconv="n"])
>>>>>  AC_SUBST(libiconv)
>>>>> +AC_CHECK_HEADER([argp.h], [
>>>>> +AC_CHECK_LIB([argp], [argp_usage], [argp_ldflags="-largp"])
>>>>> +], [AC_MSG_ERROR([Could not find argp])])
>>>>> +AC_SUBST(argp_ldflags)
>>>>
>>>> Sorry if my config-fu isn't very good:  Is this basically requiring the
>>>> user to have argp available at configure time?  Does this make it more
>>>> difficult to build on BSDs?  Or is it just a matter of adding one more
>>>> library to the already long list of dependencies?
>>>
>>> This is just to make that dependency explicit. This is a step towards
>>> the right direction.  It's not going to make it easier or harder to
>>> build on BSDs.
>>
>> Well the reason I was asking is that if it would be a big hassle for
>> someone building on BSDs to install the argp library, then a better
>> option might to just not build xenalyze.
>>
>> On the other hand, if it's no more difficult than installing libyajl (or
>> any of the other dozen dependencies), then adding a dependency is fine.
>>  And naturally in that case making the dependency explicit is the right
>> thing to do.
>>
> 
> Yes, package argp exist in FreeBSD and NetBSD.

In which case:

Acked-by: George Dunlap <george.dunlap@eu.citrix.com>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 1/2] xen{trace/analyze}: don't use 64bit versions of libc functions
  2015-06-22 10:09       ` George Dunlap
@ 2015-06-22 14:48         ` Roger Pau Monné
  2015-06-24 11:11           ` Roger Pau Monné
  0 siblings, 1 reply; 18+ messages in thread
From: Roger Pau Monné @ 2015-06-22 14:48 UTC (permalink / raw)
  To: George Dunlap, xen-devel; +Cc: Wei Liu, Olaf Hering, Ian Jackson, Ian Campbell

El 22/06/15 a les 12.09, George Dunlap ha escrit:
> On 06/22/2015 10:59 AM, Roger Pau Monné wrote:
>> El 22/06/15 a les 11.08, George Dunlap ha escrit:
>>> 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?
>>
>> Yes, according to the man page [1]:
>>
>> "Over time, increases in the size of the stat structure have led to
>> three successive versions of stat(): sys_stat() (slot __NR_oldstat),
>> sys_newstat() (slot __NR_stat), and sys_stat64() (new in kernel 2.4;
>> slot __NR_stat64). The glibc stat() wrapper function hides these details
>> from applications, invoking the most recent version of the system call
>> provided by the kernel, and repacking the returned information if
>> required for old binaries. Similar remarks apply for fstat() and lstat()."
> 
> OK, if you can confirm that you've actually tested this on a file larger
> than 4GiB, then:

No, I have only build tested it since I was trying to unbreak the build.
I don't think I will have time to test this until tomorrow, sorry for
the delay.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 1/2] xen{trace/analyze}: don't use 64bit versions of libc functions
  2015-06-22 14:48         ` Roger Pau Monné
@ 2015-06-24 11:11           ` Roger Pau Monné
  2015-06-24 13:02             ` Roger Pau Monné
  0 siblings, 1 reply; 18+ messages in thread
From: Roger Pau Monné @ 2015-06-24 11:11 UTC (permalink / raw)
  To: George Dunlap, xen-devel; +Cc: Ian Jackson, Olaf Hering, Wei Liu, Ian Campbell

El 22/06/15 a les 16.48, Roger Pau Monné ha escrit:
> El 22/06/15 a les 12.09, George Dunlap ha escrit:
>> On 06/22/2015 10:59 AM, Roger Pau Monné wrote:
>>> El 22/06/15 a les 11.08, George Dunlap ha escrit:
>>>> 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?
>>>
>>> Yes, according to the man page [1]:
>>>
>>> "Over time, increases in the size of the stat structure have led to
>>> three successive versions of stat(): sys_stat() (slot __NR_oldstat),
>>> sys_newstat() (slot __NR_stat), and sys_stat64() (new in kernel 2.4;
>>> slot __NR_stat64). The glibc stat() wrapper function hides these details
>>> from applications, invoking the most recent version of the system call
>>> provided by the kernel, and repacking the returned information if
>>> required for old binaries. Similar remarks apply for fstat() and lstat()."
>>
>> OK, if you can confirm that you've actually tested this on a file larger
>> than 4GiB, then:
> 
> No, I have only build tested it since I was trying to unbreak the build.
> I don't think I will have time to test this until tomorrow, sorry for
> the delay.

I've now tested this with a ~5GB file and it seems to work fine, I
haven't seen any error and the output looks reasonable. This was on a
64bit Dom0, if someone has a 32bit Dom0 it would be good to test it
there also.

Roger.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 1/2] xen{trace/analyze}: don't use 64bit versions of libc functions
  2015-06-24 11:11           ` Roger Pau Monné
@ 2015-06-24 13:02             ` Roger Pau Monné
  2015-06-24 13:08               ` George Dunlap
  0 siblings, 1 reply; 18+ messages in thread
From: Roger Pau Monné @ 2015-06-24 13:02 UTC (permalink / raw)
  To: George Dunlap, xen-devel; +Cc: Wei Liu, Olaf Hering, Ian Jackson, Ian Campbell

El 24/06/15 a les 13.11, Roger Pau Monné ha escrit:
> El 22/06/15 a les 16.48, Roger Pau Monné ha escrit:
>> El 22/06/15 a les 12.09, George Dunlap ha escrit:
>>> On 06/22/2015 10:59 AM, Roger Pau Monné wrote:
>>>> El 22/06/15 a les 11.08, George Dunlap ha escrit:
>>>>> 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?
>>>>
>>>> Yes, according to the man page [1]:
>>>>
>>>> "Over time, increases in the size of the stat structure have led to
>>>> three successive versions of stat(): sys_stat() (slot __NR_oldstat),
>>>> sys_newstat() (slot __NR_stat), and sys_stat64() (new in kernel 2.4;
>>>> slot __NR_stat64). The glibc stat() wrapper function hides these details
>>>> from applications, invoking the most recent version of the system call
>>>> provided by the kernel, and repacking the returned information if
>>>> required for old binaries. Similar remarks apply for fstat() and lstat()."
>>>
>>> OK, if you can confirm that you've actually tested this on a file larger
>>> than 4GiB, then:
>>
>> No, I have only build tested it since I was trying to unbreak the build.
>> I don't think I will have time to test this until tomorrow, sorry for
>> the delay.
> 
> I've now tested this with a ~5GB file and it seems to work fine, I
> haven't seen any error and the output looks reasonable. This was on a
> 64bit Dom0, if someone has a 32bit Dom0 it would be good to test it
> there also.

I've also tested on a 32bit Dom0, with and without the patches in this
series and I always end up getting the same strange output from xenalyze:

# xenalyze trace.file
No output defined, using summary.
Using VMX hardware-assisted virtualization.
scan_for_new_pcpu: Activating pcpu 0 at offset 0
Creating vcpu 0 for dom 32768
scan_for_new_pcpu: Activating pcpu 1 at offset 10376
Creating vcpu 1 for dom 32768
scan_for_new_pcpu: Activating pcpu 4 at offset 10848
Creating vcpu 4 for dom 32768
scan_for_new_pcpu: Activating pcpu 6 at offset 11176
Creating vcpu 6 for dom 32768
init_pcpus: through first trace write, done for now.
Creating domain 0
Creating vcpu 0 for dom 0
Using first_tsc for d0v0 (8109 cycles)
Creating domain 32767
Creating vcpu 1 for dom 32767
Creating vcpu 1 for dom 0
Creating vcpu 2 for dom 0
Creating vcpu 4 for dom 32767
Using first_tsc for d32767v4 (9407 cycles)
Creating vcpu 6 for dom 32767
Using first_tsc for d32767v6 (8755 cycles)
process_cpu_change: Activating pcpu 5 at offset 16664
Creating vcpu 5 for dom 32768
scan_for_new_pcpu: Activating pcpu 7 at offset 17812
Creating vcpu 7 for dom 32768
Creating vcpu 3 for dom 0
Using first_tsc for d0v3 (3369172 cycles)
Creating vcpu 0 for dom 32767
Creating vcpu 6 for dom 0
Creating vcpu 5 for dom 32767
Using first_tsc for d32767v5 (7868 cycles)
Creating vcpu 7 for dom 0
Creating vcpu 7 for dom 32767
Using first_tsc for d32767v7 (7693 cycles)
process_cpu_change: Activating pcpu 2 at offset 61284
Creating vcpu 2 for dom 32768
process_cpu_change: Activating pcpu 3 at offset 62128
Creating vcpu 3 for dom 32768
Creating vcpu 5 for dom 0
Creating vcpu 3 for dom 32767
Using first_tsc for d32767v3 (24609 cycles)
Creating vcpu 4 for dom 0
Creating vcpu 2 for dom 32767
Using first_tsc for d32767v2 (2575 cycles)
WARNING: Unexpected vcpu data type for d0v0 on proc 1! Expected 1 got 2.
Not processing
]   84007(8:4:7) 0 [ ]
WARNING: Unexpected vcpu data type for d0v0 on proc 1! Expected 1 got 2.
Not processing
]   84006(8:4:6) 0 [ ]
WARNING: Unexpected vcpu data type for d0v2 on proc 6! Expected 1 got 2.
Not processing
]   84008(8:4:8) 0 [ ]
WARNING: Unexpected vcpu data type for d0v2 on proc 6! Expected 1 got 2.
Not processing
]   84008(8:4:8) 0 [ ]
WARNING: Unexpected vcpu data type for d0v3 on proc 0! Expected 1 got 2.
Not processing
]   84006(8:4:6) 0 [ ]
Creating domain 90
Creating vcpu 0 for dom 90
Creating domain 89
Creating vcpu 0 for dom 89
Unknown hvm event: 84011
h->exit_reason 7b > exit_reason_max 38!
]   81002(8:1:2) 2 [ 7b 100d9e ]

And that's all. Since this seems to not be related to this fixes I think
they should be applied.

Roger.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 1/2] xen{trace/analyze}: don't use 64bit versions of libc functions
  2015-06-24 13:02             ` Roger Pau Monné
@ 2015-06-24 13:08               ` George Dunlap
  0 siblings, 0 replies; 18+ messages in thread
From: George Dunlap @ 2015-06-24 13:08 UTC (permalink / raw)
  To: Roger Pau Monné, xen-devel
  Cc: Wei Liu, Olaf Hering, Ian Jackson, Ian Campbell

On 06/24/2015 02:02 PM, Roger Pau Monné wrote:
> El 24/06/15 a les 13.11, Roger Pau Monné ha escrit:
>> El 22/06/15 a les 16.48, Roger Pau Monné ha escrit:
>>> El 22/06/15 a les 12.09, George Dunlap ha escrit:
>>>> On 06/22/2015 10:59 AM, Roger Pau Monné wrote:
>>>>> El 22/06/15 a les 11.08, George Dunlap ha escrit:
>>>>>> 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?
>>>>>
>>>>> Yes, according to the man page [1]:
>>>>>
>>>>> "Over time, increases in the size of the stat structure have led to
>>>>> three successive versions of stat(): sys_stat() (slot __NR_oldstat),
>>>>> sys_newstat() (slot __NR_stat), and sys_stat64() (new in kernel 2.4;
>>>>> slot __NR_stat64). The glibc stat() wrapper function hides these details
>>>>> from applications, invoking the most recent version of the system call
>>>>> provided by the kernel, and repacking the returned information if
>>>>> required for old binaries. Similar remarks apply for fstat() and lstat()."
>>>>
>>>> OK, if you can confirm that you've actually tested this on a file larger
>>>> than 4GiB, then:
>>>
>>> No, I have only build tested it since I was trying to unbreak the build.
>>> I don't think I will have time to test this until tomorrow, sorry for
>>> the delay.
>>
>> I've now tested this with a ~5GB file and it seems to work fine, I
>> haven't seen any error and the output looks reasonable. This was on a
>> 64bit Dom0, if someone has a 32bit Dom0 it would be good to test it
>> there also.
> 
> I've also tested on a 32bit Dom0, with and without the patches in this
> series and I always end up getting the same strange output from xenalyze:
> 
> # xenalyze trace.file
> No output defined, using summary.
> Using VMX hardware-assisted virtualization.
> scan_for_new_pcpu: Activating pcpu 0 at offset 0
> Creating vcpu 0 for dom 32768
> scan_for_new_pcpu: Activating pcpu 1 at offset 10376
> Creating vcpu 1 for dom 32768
> scan_for_new_pcpu: Activating pcpu 4 at offset 10848
> Creating vcpu 4 for dom 32768
> scan_for_new_pcpu: Activating pcpu 6 at offset 11176
> Creating vcpu 6 for dom 32768
> init_pcpus: through first trace write, done for now.
> Creating domain 0
> Creating vcpu 0 for dom 0
> Using first_tsc for d0v0 (8109 cycles)
> Creating domain 32767
> Creating vcpu 1 for dom 32767
> Creating vcpu 1 for dom 0
> Creating vcpu 2 for dom 0
> Creating vcpu 4 for dom 32767
> Using first_tsc for d32767v4 (9407 cycles)
> Creating vcpu 6 for dom 32767
> Using first_tsc for d32767v6 (8755 cycles)
> process_cpu_change: Activating pcpu 5 at offset 16664
> Creating vcpu 5 for dom 32768
> scan_for_new_pcpu: Activating pcpu 7 at offset 17812
> Creating vcpu 7 for dom 32768
> Creating vcpu 3 for dom 0
> Using first_tsc for d0v3 (3369172 cycles)
> Creating vcpu 0 for dom 32767
> Creating vcpu 6 for dom 0
> Creating vcpu 5 for dom 32767
> Using first_tsc for d32767v5 (7868 cycles)
> Creating vcpu 7 for dom 0
> Creating vcpu 7 for dom 32767
> Using first_tsc for d32767v7 (7693 cycles)
> process_cpu_change: Activating pcpu 2 at offset 61284
> Creating vcpu 2 for dom 32768
> process_cpu_change: Activating pcpu 3 at offset 62128
> Creating vcpu 3 for dom 32768
> Creating vcpu 5 for dom 0
> Creating vcpu 3 for dom 32767
> Using first_tsc for d32767v3 (24609 cycles)
> Creating vcpu 4 for dom 0
> Creating vcpu 2 for dom 32767
> Using first_tsc for d32767v2 (2575 cycles)
> WARNING: Unexpected vcpu data type for d0v0 on proc 1! Expected 1 got 2.
> Not processing
> ]   84007(8:4:7) 0 [ ]
> WARNING: Unexpected vcpu data type for d0v0 on proc 1! Expected 1 got 2.
> Not processing
> ]   84006(8:4:6) 0 [ ]
> WARNING: Unexpected vcpu data type for d0v2 on proc 6! Expected 1 got 2.
> Not processing
> ]   84008(8:4:8) 0 [ ]
> WARNING: Unexpected vcpu data type for d0v2 on proc 6! Expected 1 got 2.
> Not processing
> ]   84008(8:4:8) 0 [ ]
> WARNING: Unexpected vcpu data type for d0v3 on proc 0! Expected 1 got 2.
> Not processing
> ]   84006(8:4:6) 0 [ ]
> Creating domain 90
> Creating vcpu 0 for dom 90
> Creating domain 89
> Creating vcpu 0 for dom 89
> Unknown hvm event: 84011
> h->exit_reason 7b > exit_reason_max 38!
> ]   81002(8:1:2) 2 [ 7b 100d9e ]
> 
> And that's all. Since this seems to not be related to this fixes I think
> they should be applied.

+1.

(Ack is already there.)

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 0/2] xen{trace/analyze}: fix build on FreeBSD
  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  8:58 ` [PATCH 2/2] configure: check for argp Roger Pau Monne
@ 2015-06-25 12:01 ` Ian Campbell
  2 siblings, 0 replies; 18+ messages in thread
From: Ian Campbell @ 2015-06-25 12:01 UTC (permalink / raw)
  To: Roger Pau Monne; +Cc: xen-devel

On Fri, 2015-06-19 at 10:58 +0200, Roger Pau Monne wrote:
> Fix the build of xentrace/xenalyze on FreeBSD, and possibly other libcs not 
> having argp. Also fix the usage of fstat64 and O_LARGEFILE.

Both applied, thanks.

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2015-06-25 12:01 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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).