Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/tprof if column width changes, the screen must be u...



details:   https://anonhg.NetBSD.org/src/rev/7b9d45fc5fab
branches:  trunk
changeset: 372570:7b9d45fc5fab
user:      ryo <ryo%NetBSD.org@localhost>
date:      Fri Dec 09 02:19:07 2022 +0000

description:
if column width changes, the screen must be updated.

diffstat:

 usr.sbin/tprof/tprof_top.c |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (40 lines):

diff -r 41166b703473 -r 7b9d45fc5fab usr.sbin/tprof/tprof_top.c
--- a/usr.sbin/tprof/tprof_top.c        Fri Dec 09 02:01:09 2022 +0000
+++ b/usr.sbin/tprof/tprof_top.c        Fri Dec 09 02:19:07 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tprof_top.c,v 1.4 2022/12/09 01:56:40 ryo Exp $        */
+/*     $NetBSD: tprof_top.c,v 1.5 2022/12/09 02:19:07 ryo Exp $        */
 
 /*-
  * Copyright (c) 2022 Ryo Shimizu <ryo%nerv.org@localhost>
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: tprof_top.c,v 1.4 2022/12/09 01:56:40 ryo Exp $");
+__RCSID("$NetBSD: tprof_top.c,v 1.5 2022/12/09 02:19:07 ryo Exp $");
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -671,15 +671,19 @@
        for (i = 0; i < nevent; i++) {
                l = snprintf(buf, sizeof(buf), "%"PRIu64,
                    sample_n_per_event[opt_mode][i]);
-               if (sample_event_width < (u_int)l)
+               if (sample_event_width < (u_int)l) {
                        sample_event_width = l;
+                       do_redraw = true;
+               }
        }
        for (i = 0; i < nevent; i++) {
                for (n = 0; n < ncpu; n++) {
                        l = snprintf(buf, sizeof(buf), "%"PRIu64,
                            sample_n_per_event_cpu[opt_mode][nevent * n + i]);
-                       if (sample_cpu_width[n] < (u_int)l)
+                       if (sample_cpu_width[n] < (u_int)l) {
                                sample_cpu_width[n] = l;
+                               do_redraw = true;
+                       }
                }
        }
 



Home | Main Index | Thread Index | Old Index