Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Alexander_Naumov:SLE-12:Update
acct
acct-hz.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File acct-hz.patch of Package acct
Subject: acct-hz.patch --- lastcomm.c | 14 +++++++++++++- sa.c | 14 +++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) Index: acct-6.6.1/lastcomm.c =================================================================== --- acct-6.6.1.orig/lastcomm.c 2011-03-16 23:50:13.000000000 +0100 +++ acct-6.6.1/lastcomm.c 2013-12-21 23:54:26.496776873 +0100 @@ -49,6 +49,10 @@ MA 02139, USA. */ #include <pwd.h> +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif + #include "common.h" #include "files.h" #include "uid_hash.h" @@ -71,7 +75,7 @@ int debugging_enabled = 0; /* Nonzero me int strict_match_flag = 0; /* Nonzero if each record has to match all items on the command line */ int print_controls = 0; /* don't print control characters */ -int ahz = AHZ; /* for viewing logs from another system */ +int ahz = 0; /* for viewing logs from another system */ char *program_name; /* name of the program, for usage & errs */ @@ -328,6 +332,14 @@ void parse_entries(void) print_pacct_record (rec, stddebug); } + if (!ahz) // if this is the first cycle run, ahz is not set yet + { + if (rec->ac_version == 3) + ahz = 100; // value AHZ = 100 is hardcoded in acct.h, but in #ifdef __KERNEL__ block. too bad + else + ahz = sysconf(_SC_CLK_TCK); + } + if (desired_entry (this_uid, this_dev, rec->ac_comm)) { double ut = ACUTIME_2_DOUBLE (rec->ac_utime); Index: acct-6.6.1/sa.c =================================================================== --- acct-6.6.1.orig/sa.c 2011-03-16 23:50:13.000000000 +0100 +++ acct-6.6.1/sa.c 2013-12-21 23:54:26.497776877 +0100 @@ -189,7 +189,7 @@ int dont_read_summary_files = 0; int print_users = 0; int percentages = 0; /* include percentages in printout */ int user_summary_flag = 0; /* are we printing a user summary? */ -int ahz = AHZ; /* for viewing logs from another system */ +int ahz = 0; /* for viewing logs from another system */ #if defined(HAVE_ACUTIME) && defined(HAVE_ACSTIME) @@ -1172,6 +1172,18 @@ void parse_acct_entries (void) /* loop while there are entries to be had */ while ((rec = pacct_get_entry ()) != NULL) { + if (!ahz) // if this is the first cycle run, ahz is not set yet + { + if (rec->ac_version == 3) + ahz = 100; // value AHZ = 100 is hardcoded in acct.h, but in #ifdef __KERNEL__ block. too bad + else + ahz = sysconf(_SC_CLK_TCK); + + if (debugging_enabled) + { + fprintf (stddebug, "AHZ -> %d\n", ahz); + } + } #ifdef HAVE_ACUTIME double ut = comp_t_2_double (rec->ac_utime) / CURR_AHZ; #endif
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor