Patchwork v2 fix /proc/self/maps output

login
register
mail settings
Submitter Christophe Lyon
Date April 2, 2013, 12:03 p.m.
Message ID <CAKdteOYnrnY91NsuUKmoyMypRYK+aPs2t1ACJBPFK8pAXZTweA@mail.gmail.com>
Download mbox | patch
Permalink /patch/232987/
State New
Headers show

Comments

Christophe Lyon - April 2, 2013, 12:03 p.m.
Add a space at end of line when there is no filename to print, to
conform to linux kernel format (see show_map_vma() in
fs/proc/task_mmu.c).

Signed-off-by: Christophe Lyon <christophe.lyon@linaro.org>
---

Changes v1-v2:
Additional space is now part of the format string.

 linux-user/syscall.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--
1.7.10.4
Christophe Lyon - May 5, 2013, 9:01 p.m.
Ping?

On 2 April 2013 14:03, Christophe Lyon <christophe.lyon@linaro.org> wrote:
> Add a space at end of line when there is no filename to print, to
> conform to linux kernel format (see show_map_vma() in
> fs/proc/task_mmu.c).
>
> Signed-off-by: Christophe Lyon <christophe.lyon@linaro.org>
> ---
>
> Changes v1-v2:
> Additional space is now part of the format string.
>
>  linux-user/syscall.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index a148d9f..c3c5c11 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -5013,10 +5013,10 @@ static int open_self_maps(void *cpu_env, int fd)
>          }
>          if (h2g_valid(min) && h2g_valid(max)) {
>              dprintf(fd, TARGET_ABI_FMT_lx "-" TARGET_ABI_FMT_lx
> -                    " %c%c%c%c %08" PRIx64 " %02x:%02x %d%s%s\n",
> +                    " %c%c%c%c %08" PRIx64 " %02x:%02x %d %s%s\n",
>                      h2g(min), h2g(max), flag_r, flag_w,
>                      flag_x, flag_p, offset, dev_maj, dev_min, inode,
> -                    path[0] ? "          " : "", path);
> +                    path[0] ? "         " : "", path);
>          }
>      }
>
> --
> 1.7.10.4
Peter Maydell - May 5, 2013, 9:11 p.m.
On 2 April 2013 13:03, Christophe Lyon <christophe.lyon@linaro.org> wrote:
> Add a space at end of line when there is no filename to print, to
> conform to linux kernel format (see show_map_vma() in
> fs/proc/task_mmu.c).
>
> Signed-off-by: Christophe Lyon <christophe.lyon@linaro.org>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

(CCing Riku and/or trivial might have helped.)

-- PMM


> ---
>
> Changes v1-v2:
> Additional space is now part of the format string.
>
>  linux-user/syscall.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index a148d9f..c3c5c11 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -5013,10 +5013,10 @@ static int open_self_maps(void *cpu_env, int fd)
>          }
>          if (h2g_valid(min) && h2g_valid(max)) {
>              dprintf(fd, TARGET_ABI_FMT_lx "-" TARGET_ABI_FMT_lx
> -                    " %c%c%c%c %08" PRIx64 " %02x:%02x %d%s%s\n",
> +                    " %c%c%c%c %08" PRIx64 " %02x:%02x %d %s%s\n",
>                      h2g(min), h2g(max), flag_r, flag_w,
>                      flag_x, flag_p, offset, dev_maj, dev_min, inode,
> -                    path[0] ? "          " : "", path);
> +                    path[0] ? "         " : "", path);
>          }
>      }
>
> --
> 1.7.10.4
>
Michael Tokarev - May 14, 2013, 5:49 a.m.
02.04.2013 16:03, Christophe Lyon wrote:
> Add a space at end of line when there is no filename to print, to
> conform to linux kernel format (see show_map_vma() in
> fs/proc/task_mmu.c).
> 
> Signed-off-by: Christophe Lyon <christophe.lyon@linaro.org>

Thanks, applied to the trivial patches queue.

/mjt

> Changes v1-v2:
> Additional space is now part of the format string.
> 
>  linux-user/syscall.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index a148d9f..c3c5c11 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -5013,10 +5013,10 @@ static int open_self_maps(void *cpu_env, int fd)
>          }
>          if (h2g_valid(min) && h2g_valid(max)) {
>              dprintf(fd, TARGET_ABI_FMT_lx "-" TARGET_ABI_FMT_lx
> -                    " %c%c%c%c %08" PRIx64 " %02x:%02x %d%s%s\n",
> +                    " %c%c%c%c %08" PRIx64 " %02x:%02x %d %s%s\n",
>                      h2g(min), h2g(max), flag_r, flag_w,
>                      flag_x, flag_p, offset, dev_maj, dev_min, inode,
> -                    path[0] ? "          " : "", path);
> +                    path[0] ? "         " : "", path);
>          }
>      }
>

Patch

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index a148d9f..c3c5c11 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -5013,10 +5013,10 @@  static int open_self_maps(void *cpu_env, int fd)
         }
         if (h2g_valid(min) && h2g_valid(max)) {
             dprintf(fd, TARGET_ABI_FMT_lx "-" TARGET_ABI_FMT_lx
-                    " %c%c%c%c %08" PRIx64 " %02x:%02x %d%s%s\n",
+                    " %c%c%c%c %08" PRIx64 " %02x:%02x %d %s%s\n",
                     h2g(min), h2g(max), flag_r, flag_w,
                     flag_x, flag_p, offset, dev_maj, dev_min, inode,
-                    path[0] ? "          " : "", path);
+                    path[0] ? "         " : "", path);
         }
     }