Now that's truly weird. It's saying that the comparison is of always zero
values, but the actual report lines have:
Host IP Address Data Sent Data Rcvd
212.97.170.63 212.97.170.63 60 0.0 % 0 0.0 %
Has non-zero values...
This might be a total tangent, but what version of gcc are you running?
I had you put %llu in the traceEvent() lines, because there's a gcc 'issue'
(they swear it's not a bug):
When you pass stuff to printf() it gets passed as pointers or as full word
(4 byte) values. Then based on the format spec, it's pulled off the stack
and interpreted. However, a long long is 8 bytes, but with a %d
specification it's only pulls off the 4bytes, leaving a 'stray' 4 byte
value/pointer.
So while you can usually get away with ignoring the l format specifier, if
you don't have it for long longs it's trouble. This leads to the expected
albeit IMO nonsense output (the (null) comes from the extra 4 bytes):
$ ./gcc_322_unsignedlonglong_testprogram
# c 1 - nonsense
# c 2 - nonsense
# c 3 - nonsense
# c 577732784177545220
# c 1 - (null) stuff
# c 2 - (null) stuff
# c 3 - (null) stuff
# c 4 - stuff
>From this test program:
int main(int argc, char *argv[]) {
unsigned long long ullCount;
unsigned long ulCount;
ulCount = 1;
printf("# c %d - %s\n", ulCount, "nonsense");
ulCount++;
printf("# c %u - %s\n", ulCount, "nonsense");
ulCount++;
printf("# c %lu - %s\n", ulCount, "nonsense");
ulCount++;
printf("# c %llu\n", ulCount, "nonsense");
ullCount = 1;
printf("# c %d - %s %s\n", ullCount, "stuff");
ullCount++;
printf("# c %u - %s %s\n", ullCount, "stuff");
ullCount++;
printf("# c %lu - %s %s\n", ullCount, "stuff");
ullCount++;
printf("# c %llu - %s\n", ullCount, "stuff");
}
(Cut & paste the code into a file, say x.c and compile it thus:
$ gcc -o x x.c
$ ./x
And let me know. If you're not using an older gcc which doesn't have this
'issue', then I don't see how the comparison could be reporting 0s.
-----Burton
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Ralf
> Stodt
> Sent: Thursday, May 20, 2004 4:46 PM
> To: [EMAIL PROTECTED]
> Subject: [Ntop] Re: Re: sorting problems
>
>
> Burton M. Strauss III wrote:
> > But the changes I had you make should - if you're running w/ trace
> > level 4+ (required for CONST_TRACE_NOISY) and with the -L option -
> > log enough data to see the actual compares. I posted some sample
> > output in that message too.
>
> Ah, trace-level.... Always started ntop with default trace-level 3.....
> Below you find the logs and the appropriate html-code.
>
> greets
>
> __________________________________________________________________
> ___________________________________________________
>
> May 21 01:34:28 debian ntop[20031]: TEMP:
> cmpHostsFctn(0x80abf80, 0x80abf84) col 3 a_ 0 b_ 0 rc=0
<snip />
> __________________________________________________________________
> ___________________________________________________
>
> <HTML>
> <HEAD>
> <TITLE>Remote to Remote IP Traffic</TITLE>
> <META HTTP-EQUIV=REFRESH CONTENT=120>
> <META HTTP-EQUIV=Pragma CONTENT=no-cache>
> <META HTTP-EQUIV=Cache-Control CONTENT=no-cache>
> <LINK REL=stylesheet HREF="/style.css" type="text/css">
> <SCRIPT SRC="/functions.js" TYPE="text/javascript"
> LANGUAGE="javascript"></SCRIPT>
> </HEAD>
> <BODY BACKGROUND="/white_bg.gif" BGCOLOR="#FFFFFF" LINK=blue VLINK=blue>
> <p> </p>
> <center>
> <H2><font face="Helvetica, Arial, Sans Serif">Remote to Remote IP
> Traffic</font></H2>
> </center>
> <CENTER>
> <TABLE BORDER=1 CELLSPACING=0 CELLPADDING=2 WIDTH="80%">
> <TR BGCOLOR="#E7E9F2"><TH ><A
> HREF=/ipR2R.html?col=1>Host</A></TH><TH ><A
> HREF=/ipR2R.html?col=2>IP Address</A></TH>
> <TH COLSPAN=2><A
> HREF=/ipR2R.html?col=-3>Data Sent <img
> src="/arrow_down.gif" border="0" alt="Descending order, click to
> reverse"></A></TH><TH COLSPAN=2><A
> HREF=/ipR2R.html?col=4>Data Rcvd</A></TH></TR>
> <TR ><th align="left" nowrap width="250">
> <a href="/212.97.170.63.html" >212.97.170.63</a>
> </th>
> <TD ALIGN=RIGHT>212.97.170.63</TD></TD><TD
> ALIGN=RIGHT>60</TD><TD ALIGN=RIGHT>0.0 %</TD><TD
> ALIGN=RIGHT>0</TD><TD
> ALIGN=RIGHT>0.0 %</TD></TR>
<snip />
_______________________________________________
Ntop mailing list
[EMAIL PROTECTED]
http://listgateway.unipi.it/mailman/listinfo/ntop