public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/15] pull: sfdisk and dmesg resubmission, plus bits and bobs
@ 2013-06-16 18:53 Sami Kerola
  2013-06-16 18:53 ` [PATCH 01/15] renice: exit with non-zero value when arguments cause warnings Sami Kerola
                   ` (16 more replies)
  0 siblings, 17 replies; 27+ messages in thread
From: Sami Kerola @ 2013-06-16 18:53 UTC (permalink / raw)
  To: util-linux; +Cc: kerolasa

Hi Karel and others,

Half of the patches in this pull request are re-worked changes, which
were rejected earlier.  The sfdisk error printing is now using plain
glibc warn() and err() functions.  The dmesg time format selection is
much cleaner when done the way Karel proposed.

Unfortunately the most troubling dmesg patch is now dropped by me.  I had
a look how systemd determines boot time, and it seem very early at
execution clock_gettime() is called, and results are saved.  If dmesg
should agree with systemd when startup happen I see two possible options;

1. Make dmesg to get system startup time from systemd using dbus.

2. Make both dmesg and systemd to ask start up time from kernel.

I feel first option is not great.  The systemd boot time stamp is similar
sort of approximation as reading fstat from /proc/1.  Also asking when
system started from system itself feels more neutral than consulting a
software the system started.

If the second option is favored a kernel patch, such as the one below, is
needed and a bit coordination to make various programs to use the
boottime from kernel.  Meanwhile it migth be fine that differnt programs
using differnet time stamps for klog messages.

Any opinions about klog time stamps?


--- a/kernel/ksysfs.c
+++ b/kernel/ksysfs.c
@@ -157,6 +157,16 @@ static ssize_t rcu_expedited_store(struct kobject
*kobj,
 }
 KERNEL_ATTR_RW(rcu_expedited);
 
+/* High precision timestamp of the system boot. */
+static ssize_t boottime_show(struct kobject *kobj,
+                            struct kobj_attribute *attr, char *buf)
+{
+       struct timespec ts;
+       getboottime(&ts);
+       return sprintf(buf, "%ld.%ld\n", ts.tv_sec, ts.tv_nsec);
+}
+KERNEL_ATTR_RO(hp_uptime);
+
 /*
  * Make /sys/kernel/notes give the raw contents of our kernel .notes
  * section.
  */
@@ -197,6 +207,7 @@ static struct attribute * kernel_attrs[] = {
        &vmcoreinfo_attr.attr,
 #endif
        &rcu_expedited_attr.attr,
+       &hp_uptime_attr.attr,
        NULL
 };


And comments about & review of the patches are also highly appreciated.


The following changes since commit 76b86412c607ba47f43ef7c0535436bca2a660d2:

  fdisk: don't use ptes[] in generic code (2013-06-12 17:39:09 +0200)

are available in the git repository at:

  git://github.com/kerolasa/lelux-utiliteetit.git 2013wk23

for you to fetch changes up to 314e07144b26e30a5bd5b0a41fb18fe3020dfe8a:

  hexdump: use simple printing functions when possible (2013-06-16 19:00:33 +0100)

----------------------------------------------------------------
Sami Kerola (15):
      renice: exit with non-zero value when arguments cause warnings
      sfdisk: use libc error printing function, and symbolic exit values
      sfdisk: clean up usage() functions
      sfdisk: use program_invocation_short_name to determine program name
      docs: correct sfdisk --activate instructions
      sfdisk: remove --unhide and related functions
      sfdisk: replace my_warn() with warnx()
      dmesg: convert time format bitfield to enum
      dmesg: add --time-format option
      dmesg: add iso-8601 time format
      docs: add --time-format option and ISO-8601 format to manual
      dmesg: regroup time related options close to each other
      sd-daemon: update files taken from systemd project
      hexdump: remove unnecessary global variables
      hexdump: use simple printing functions when possible

 fdisks/sfdisk.8        |  33 +++-
 fdisks/sfdisk.c        | 451 ++++++++++++++++++-------------------------------
 misc-utils/sd-daemon.c | 100 +++++------
 misc-utils/sd-daemon.h |  14 +-
 sys-utils/dmesg.1      |  22 +++
 sys-utils/dmesg.c      | 214 +++++++++++++----------
 sys-utils/renice.c     |   4 +-
 text-utils/display.c   |  16 +-
 text-utils/hexdump.c   |   4 +-
 text-utils/hexdump.h   |   2 -
 10 files changed, 408 insertions(+), 452 deletions(-)



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

end of thread, other threads:[~2013-09-03  8:29 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-16 18:53 [PATCH 00/15] pull: sfdisk and dmesg resubmission, plus bits and bobs Sami Kerola
2013-06-16 18:53 ` [PATCH 01/15] renice: exit with non-zero value when arguments cause warnings Sami Kerola
2013-06-16 18:53 ` [PATCH 02/15] sfdisk: use libc error printing function, and symbolic exit values Sami Kerola
2013-06-16 18:53 ` [PATCH 03/15] sfdisk: clean up usage() functions Sami Kerola
2013-06-16 18:53 ` [PATCH 04/15] sfdisk: use program_invocation_short_name to determine program name Sami Kerola
2013-06-16 18:53 ` [PATCH 05/15] docs: correct sfdisk --activate instructions Sami Kerola
2013-06-16 18:53 ` [PATCH 06/15] sfdisk: remove --unhide and related functions Sami Kerola
2013-06-16 18:53 ` [PATCH 07/15] sfdisk: replace my_warn() with warnx() Sami Kerola
2013-06-16 18:53 ` [PATCH 08/15] dmesg: convert time format bitfield to enum Sami Kerola
2013-07-01  9:36   ` Karel Zak
2013-06-16 18:53 ` [PATCH 09/15] dmesg: add --time-format option Sami Kerola
2013-06-16 18:53 ` [PATCH 10/15] dmesg: add iso-8601 time format Sami Kerola
2013-07-01  9:25   ` Karel Zak
2013-07-01 10:54     ` Sami Kerola
2013-06-16 18:53 ` [PATCH 11/15] docs: add --time-format option and ISO-8601 format to manual Sami Kerola
2013-06-16 18:53 ` [PATCH 12/15] dmesg: regroup time related options close to each other Sami Kerola
2013-06-16 18:53 ` [PATCH 13/15] sd-daemon: update files taken from systemd project Sami Kerola
2013-06-16 18:53 ` [PATCH 14/15] hexdump: remove unnecessary global variables Sami Kerola
2013-09-02 23:22   ` Dave Reisner
2013-09-03  7:15     ` Sami Kerola
2013-09-03  8:29       ` Karel Zak
2013-06-16 18:53 ` [PATCH 15/15] hexdump: use simple printing functions when possible Sami Kerola
2013-07-01  9:01   ` Karel Zak
2013-07-01 10:58     ` Sami Kerola
2013-06-17 12:31 ` [PATCH 00/15] pull: sfdisk and dmesg resubmission, plus bits and bobs Karel Zak
2013-06-17 20:14   ` Sami Kerola
2013-07-01  9:39 ` Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox