<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:\5B8B\4F53;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:\5B8B\4F53;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@\5B8B\4F53";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        text-align:justify;
        text-justify:inter-ideograph;
        font-size:10.5pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
/* Page Definitions */
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=ZH-CN link=blue vlink=purple style='text-justify-trim:punctuation'>
<div class=Section1>
<p class=MsoNormal><span lang=EN-US>Hi!<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>create the rrdtool with the following
statement, I wanna to store the data from '00:00' of the day, and hope to store
values at '00:00' everyday with "RRA:LAST:0.5:288:37200". but after fetch
the data, I found it will output the value with timestamp '08:00' in that day.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>[CODE]<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>#!/bin/sh<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>start=`date +'00:00 %m/%e/%Y'`<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>/usr/bin/rrdtool create $1.rrd \<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> --start "$start" \<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> --step 300 \<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> DS:total:GAUGE:600:0:U \<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> DS:new:GAUGE:600:0:U \<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> RRA:LAST:0.5:1:288 \<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> RRA:LAST:0.5:12:720 \<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> RRA:LAST:0.5:288:37200 \<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> RRA:AVERAGE:0.5:1:288 \<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> RRA:AVERAGE:0.5:12:720 \<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> RRA:AVERAGE:0.5:288:37200<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>[/CODE]<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>this problem is caused by the lines in
rrd_fetch.c:<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>243 cal_end
= (rrd.live_head->last_up - (rrd.live_head->last_up<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>244
% (rrd.rra_def[i].pdp_cnt<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>245
*<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>246
rrd.stat_head-><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>248
pdp_step)));<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>pdp_step = 300, pdp_cnt = 288, so pdp_cnt*
pdp_step = 86400. <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>0 seconds since 1970-1-1 0:0:0 UTC, but it is
also since 1970-1-1 8:0:0 CST. <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>For example, <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>2008-11-25 0: 0: 0 CST= 1227542400, <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>1227542400 % 86400 = 57600, <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>1227542400 - 57600 = 1227484800 = 2008-11-24
8: 0: 0: 0 CST.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>Even set timezone to UTC+0, but rrd start
from 1:00, "RRA:LAST:0.5:288:37200 " still can't produce data
at 1:00 everyday. I hope it should generate a data every 86400 from the start
time. the following patch will add create_time field to rrd database, and time
calculation will based on create_time.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>[CODE]<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>diff -Nur
rrdtool-1.3.4/rrdtool-1.3.4/src/rrd_create.c
rrdtool-1.3.4_/rrdtool-1.3.4/src/rrd_create.c<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>---
rrdtool-1.3.4/rrdtool-1.3.4/src/rrd_create.c Sun
Oct 5 00:04:04 2008<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>+++
rrdtool-1.3.4_/rrdtool-1.3.4/src/rrd_create.c Tue Nov 25 17:08:12 2008<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>@@ -152,6 +152,7 @@<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> rrd.rra_def =
NULL;<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>
rrd.live_head->last_up = last_up;<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>+
rrd.stat_head->create_time = last_up;<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> /* optind points
to the first non-option command line arg,<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> * in this
case, the file name. */<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>@@ -708,7 +709,7 @@<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>
rrd->pdp_prep->scratch[PDP_val].u_val = 0.0;<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>
rrd->pdp_prep->scratch[PDP_unkn_sec_cnt].u_cnt =<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>-
rrd->live_head->last_up % rrd->stat_head->pdp_step;<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>+
(rrd->live_head->last_up - rrd->stat_head->create_time) %
rrd->stat_head->pdp_step;<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> for (i = 0; i <
rrd->stat_head->ds_cnt; i++)<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>
write(rrd_file, rrd->pdp_prep, sizeof(pdp_prep_t));<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>@@ -745,7 +746,7 @@<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>
rrd->cdp_prep->scratch[CDP_val].u_val = DNAN;<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>
/* startup missing pdp count */<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>
rrd->cdp_prep->scratch[CDP_unkn_pdp_cnt].u_cnt =<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>-
((rrd->live_head->last_up -<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>+
((rrd->live_head->last_up - rrd->stat_head->create_time -<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>
rrd->pdp_prep->scratch[PDP_unkn_sec_cnt].u_cnt)<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>
% (rrd->stat_head->pdp_step<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>
* rrd->rra_def[i].pdp_cnt)) / rrd->stat_head->pdp_step;<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>diff -Nur rrdtool-1.3.4/rrdtool-1.3.4/src/rrd_dump.c
rrdtool-1.3.4_/rrdtool-1.3.4/src/rrd_dump.c<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>---
rrdtool-1.3.4/rrdtool-1.3.4/src/rrd_dump.c Sun
Oct 5 00:04:04 2008<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>+++
rrdtool-1.3.4_/rrdtool-1.3.4/src/rrd_dump.c Tue Nov 25 17:08:20 2008<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>@@ -96,6 +96,14 @@<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> fprintf(out_file,
"\t<step> %lu </step> <!-- Seconds -->\n",<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>
rrd.stat_head->pdp_step);<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> #if HAVE_STRFTIME<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>+
localtime_r(&rrd.stat_head->create_time, &tm);<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>+ strftime(somestring,
200, "%Y-%m-%d %H:%M:%S %Z", &tm);<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>+#else<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>+# error "Need strftime"<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>+#endif<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>+ fprintf(out_file,
"\t<createtime> %lu </createtime> <!-- %s -->\n\n",<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>+
(unsigned long) rrd.stat_head->create_time, somestring);<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>+#if HAVE_STRFTIME<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>
localtime_r(&rrd.live_head->last_up, &tm);<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>
strftime(somestring, 200, "%Y-%m-%d %H:%M:%S %Z", &tm);<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> #else<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>@@ -393,7 +401,7 @@<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>
ii = 0; /* wrap if max row cnt is reached */<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>
}<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>
now = (rrd.live_head->last_up<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>-
- rrd.live_head->last_up<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>+ -
(rrd.live_head->last_up - rrd.stat_head->create_time)<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>
% (rrd.rra_def[i].pdp_cnt * rrd.stat_head->pdp_step))<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>
+ (timer * rrd.rra_def[i].pdp_cnt * rrd.stat_head->pdp_step);<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>diff -Nur
rrdtool-1.3.4/rrdtool-1.3.4/src/rrd_fetch.c
rrdtool-1.3.4_/rrdtool-1.3.4/src/rrd_fetch.c<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>---
rrdtool-1.3.4/rrdtool-1.3.4/src/rrd_fetch.c Sun
Oct 5 00:04:04 2008<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>+++
rrdtool-1.3.4_/rrdtool-1.3.4/src/rrd_fetch.c Tue Nov 25 17:08:30
2008<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>@@ -240,7 +240,7 @@<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> for (i = 0;
(unsigned) i < rrd.stat_head->rra_cnt; i++) {<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>
if (cf_conv(rrd.rra_def[i].cf_nam) == cf_idx) {<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>-
cal_end = (rrd.live_head->last_up - (rrd.live_head->last_up<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>+
cal_end = (rrd.live_head->last_up - ((rrd.live_head->last_up -
rrd.stat_head->create_time)<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>
% (rrd.rra_def[i].pdp_cnt<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>
*<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>
rrd.stat_head-><o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>@@ -310,8 +310,8 @@<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> /* set the wish
parameters to their real values */<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> *step =
rrd.stat_head->pdp_step * rrd.rra_def[chosen_rra].pdp_cnt;<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>- *start -= (*start %
*step);<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>- *end += (*step - *end %
*step);<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>+ *start -= (((*start) -
rrd.stat_head->create_time) % *step);<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>+ *end += (*step - ((*end)
- rrd.stat_head->create_time) % *step);<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> rows = (*end -
*start) / *step + 1;<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> #ifdef DEBUG<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>@@ -341,11 +341,11 @@<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> /* find start and
end offset */<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> rra_end_time =
(rrd.live_head->last_up<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>-
- (rrd.live_head->last_up % *step));<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>+
- ((rrd.live_head->last_up - rrd.stat_head->create_time) % *step));<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> rra_start_time =
(rra_end_time<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>
- (*step * (rrd.rra_def[chosen_rra].row_cnt - 1)));<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> /* here's an error
by one if we don't be careful */<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>- start_offset = (long)
(*start + *step - rra_start_time) / (long) *step;<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>+ start_offset =
(long)(((double)(*start)/(long)*step) + 1 -
((double)(rra_start_time)/(long)*step));<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> end_offset =
(long) (rra_end_time - *end) / (long) *step;<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> #ifdef DEBUG<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> fprintf(stderr,<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>diff -Nur
rrdtool-1.3.4/rrdtool-1.3.4/src/rrd_format.h
rrdtool-1.3.4_/rrdtool-1.3.4/src/rrd_format.h<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>---
rrdtool-1.3.4/rrdtool-1.3.4/src/rrd_format.h Sun
Oct 5 00:04:04 2008<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>+++
rrdtool-1.3.4_/rrdtool-1.3.4/src/rrd_format.h Tue
Nov 25 17:08:42 2008<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>@@ -117,6 +117,7 @@<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>
char version[5]; /* version of the
format */<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>
double float_cookie; /* is it the correct double<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>
* representation ? */<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>+
time_t create_time; /* when was rrd created */<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> /* Data Base
Structure Definition **** */<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> unsigned long
ds_cnt; /* how many different ds provide<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>diff -Nur
rrdtool-1.3.4/rrdtool-1.3.4/src/rrd_restore.c rrdtool-1.3.4_/rrdtool-1.3.4/src/rrd_restore.c<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>---
rrdtool-1.3.4/rrdtool-1.3.4/src/rrd_restore.c Sun Oct 5
00:04:04 2008<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>+++
rrdtool-1.3.4_/rrdtool-1.3.4/src/rrd_restore.c Tue
Nov 25 17:08:52 2008<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>@@ -872,6 +872,9 @@<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>
else if (xmlStrcmp(child->name, (const xmlChar *) "step") == 0)<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>
status = get_int_from_node(doc, child,<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>
(int *) &rrd->stat_head->pdp_step);<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>+ else
if (xmlStrcmp(child->name, (const xmlChar *) "createtime") == 0)<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>+
status = get_int_from_node(doc, child,<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>+
(int *) &rrd->stat_head->create_time);<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>
else if (xmlStrcmp(child->name, (const xmlChar *) "lastupdate") ==
0)<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>
status = get_int_from_node(doc, child,<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>
(int *) &rrd->live_head->last_up);<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>diff -Nur
rrdtool-1.3.4/rrdtool-1.3.4/src/rrd_update.c
rrdtool-1.3.4_/rrdtool-1.3.4/src/rrd_update.c<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>---
rrdtool-1.3.4/rrdtool-1.3.4/src/rrd_update.c Sun
Oct 5 00:04:04 2008<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>+++
rrdtool-1.3.4_/rrdtool-1.3.4/src/rrd_update.c Tue
Nov 25 17:08:56 2008<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>@@ -1131,11 +1131,11 @@<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> unsigned long
occu_pdp_age; /* how long ago was the last pdp_step time */<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> /* when was the
current pdp started */<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>- proc_pdp_age =
rrd->live_head->last_up % rrd->stat_head->pdp_step;<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>+ proc_pdp_age
= (rrd->live_head->last_up - rrd->stat_head->create_time) %
rrd->stat_head->pdp_step;<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> proc_pdp_st =
rrd->live_head->last_up - proc_pdp_age;<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> /* when did the
last pdp_st occur */<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>- occu_pdp_age =
current_time % rrd->stat_head->pdp_step;<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>+ occu_pdp_age =
(current_time - rrd->stat_head->create_time) %
rrd->stat_head->pdp_step;<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> occu_pdp_st =
current_time - occu_pdp_age;<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US> if (occu_pdp_st
> proc_pdp_st) {<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>[/CODE]<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US>--<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US>zou guangxian<o:p></o:p></span></p>
</div>
</body>
</html>