/*
- * Sherlock Library -- Poor Man's Profiler
+ * UCW Library -- Poor Man's Profiler
*
* (c) 2001 Martin Mares <mj@ucw.cz>
+ *
+ * This software may be freely distributed and used according to the terms
+ * of the GNU Lesser General Public License.
*/
#include "lib/lib.h"
if (o->usec < 0)
{
o->usec += 1000000;
- o->sec++;
+ o->sec--;
}
else while (o->usec >= 1000000)
{
o->usec -= 1000000;
- o->sec--;
+ o->sec++;
}
}
}
int
prof_tsc_format(char *buf, struct prof_tsc *c)
{
- return sprintf(buf, "%Ld", c->ticks);
+ return sprintf(buf, "%lld", c->ticks);
}
#endif
void
prof_ktsc_switch(struct prof_ktsc *o, struct prof_ktsc *n)
{
- u64 u, s;
+ unsigned long long u, s;
byte buf[256];
int l = pread(self_prof_fd, buf, sizeof(buf)-1, 0);
ASSERT(l > 0 && l < (int)sizeof(buf)-1);
buf[l] = 0;
- l = sscanf(buf, "%Ld%Ld", &u, &s);
+ l = sscanf(buf, "%lld%lld", &u, &s);
ASSERT(l == 2);
if (n)
int
prof_ktsc_format(char *buf, struct prof_ktsc *c)
{
- return sprintf(buf, "%Ld+%Ld", c->ticks_user, c->ticks_sys);
+ return sprintf(buf, "%lld+%lld", (long long) c->ticks_user, (long long) c->ticks_sys);
}
#endif