chiark / gitweb /
Update acct.h to the one from linux-source-3.2 .
authorJonathan Amery <jdamery+zgit@ysolde.ucam.org>
Mon, 6 Oct 2014 12:05:43 +0000 (13:05 +0100)
committerJonathan Amery <jdamery+zgit@ysolde.ucam.org>
Mon, 6 Oct 2014 12:05:43 +0000 (13:05 +0100)
linux/jiffies.h is no-longer a standard header; and the new acct.h only
needs it if _KERNEL_.

None of the other changes appear to affect acctdump.

cprogs/acct.h

index 9a66401073fc1b8ff8e90b2d70d020c032a9900e..3e4737fa6cce71710982762cb80efab516033319 100644 (file)
@@ -16,7 +16,6 @@
 #define _LINUX_ACCT_H
 
 #include <linux/types.h>
-#include <linux/jiffies.h>
 
 #include <asm/param.h>
 #include <asm/byteorder.h>
@@ -116,22 +115,24 @@ struct acct_v3
 
 #ifdef __KERNEL__
 
-#include <linux/config.h>
 
 #ifdef CONFIG_BSD_PROCESS_ACCT
 struct vfsmount;
 struct super_block;
+struct pacct_struct;
+struct pid_namespace;
+extern int acct_parm[]; /* for sysctl */
 extern void acct_auto_close_mnt(struct vfsmount *m);
 extern void acct_auto_close(struct super_block *sb);
-extern void acct_process(long exitcode);
-extern void acct_update_integrals(struct task_struct *tsk);
-extern void acct_clear_integrals(struct task_struct *tsk);
+extern void acct_collect(long exitcode, int group_dead);
+extern void acct_process(void);
+extern void acct_exit_ns(struct pid_namespace *);
 #else
 #define acct_auto_close_mnt(x) do { } while (0)
 #define acct_auto_close(x)     do { } while (0)
-#define acct_process(x)                do { } while (0)
-#define acct_update_integrals(x)               do { } while (0)
-#define acct_clear_integrals(task)     do { } while (0)
+#define acct_collect(x,y)      do { } while (0)
+#define acct_process()         do { } while (0)
+#define acct_exit_ns(ns)       do { } while (0)
 #endif
 
 /*
@@ -165,6 +166,7 @@ typedef struct acct acct_t;
 #endif /* __KERNEL */
 
 #ifdef __KERNEL__
+#include <linux/jiffies.h>
 /*
  * Yet another set of HZ to *HZ helper functions.
  * See <linux/jiffies.h> for the original.
@@ -173,7 +175,11 @@ typedef struct acct acct_t;
 static inline u32 jiffies_to_AHZ(unsigned long x)
 {
 #if (TICK_NSEC % (NSEC_PER_SEC / AHZ)) == 0
+# if HZ < AHZ
+       return x * (AHZ / HZ);
+# else
        return x / (HZ / AHZ);
+# endif
 #else
         u64 tmp = (u64)x * TICK_NSEC;
         do_div(tmp, (NSEC_PER_SEC / AHZ));