Re: [Clamav-devel] build & debugging ex1.c

2008-12-04 Thread Török Edwin
On 2008-12-04 23:18, Thomasz Blaszczyk wrote:
> Hi,
> I just want to debug ex1.c in Code::Blocks IDE,
> But it fails, Please have look at my screenshot: http://omploader.org/vem1m
>
> What I did:
> I've created new folder  'ex1' and I've copied ex1.c file to this folder.
> Next I've moved all files from libclamav to this folder.
> I change only one line in ex1.c:
> #include 
> to
> #include "clamav.h"
>
> When I build it fails, saying:
>
> obj/Debug/ex1.o||In function `main':|
> /home/tomb/projects/aau/virus_scanner/codeblocks/ex1/ex1.c|64|undefined
> reference to `cl_retdbdir'|
> /home/tomb/projects/aau/virus_scanner/codeblocks/ex1/ex1.c|64|undefined
> reference to `cl_load'|
> /home/tomb/projects/aau/virus_scanner/codeblocks/ex1/ex1.c|65|undefined
> reference to `cl_strerror'|
> /home/tomb/projects/aau/virus_scanner/codeblocks/ex1/ex1.c|73|undefined
> reference to `cl_build'|
> /home/tomb/projects/aau/virus_scanner/codeblocks/ex1/ex1.c|74|undefined
> reference to `cl_strerror'|
> /home/tomb/projects/aau/virus_scanner/codeblocks/ex1/ex1.c|75|undefined
> reference to `cl_free'|
> /home/tomb/projects/aau/virus_scanner/codeblocks/ex1/ex1.c|93|undefined
> reference to `cl_scandesc'|
> /home/tomb/projects/aau/virus_scanner/codeblocks/ex1/ex1.c|99|undefined
> reference to `cl_strerror'|
> /home/tomb/projects/aau/virus_scanner/codeblocks/ex1/ex1.c|100|undefined
> reference to `cl_free'|
> /home/tomb/projects/aau/virus_scanner/codeblocks/ex1/ex1.c|112|undefined
> reference to `cl_free'|
>   

The usual way to do is to link your program with clamav, by using -lclamav.

Since you already moved the files, you should actually add those to your
project.

> ||=== Build finished: 10 errors, 0 warnings ===|
>
>
> What am I missing. I have expected that steps I did will succeed.  Can
> anyone help?  .I am new to linux compilers.

I'd suggest you to read about how linking works on Linux, how to build
your code, how to profile your code, etc. before
doing performance measurements.

>  I would like to measure
> performance for BM and AC algorithms.

You can use clamscan for that.

You can use oprofile to locate "hotspots" in the code, but be careful in
how you interpret them (read oprofile docs, basically if you do
asm-level profiling
the profile counts will be off by a few instructions due to pipelining).

Also read about how you should do performance measurements, there are
some things to watch out for:
 - disk caching effects (repeat the measurements at least 3 or more
times, or to be sure flush the disk cache each time (as root do 'sync;
echo 3 >/proc/sys/vm/drop_caches; sync')
- make sure no other app is running that uses CPU
- turn off cron (they tend to fire at wrong time)
- turn off CPU frequency scaling
- set CPU governor to max performance


Best regards,
--Edwin
___
http://lurker.clamav.net/list/clamav-devel.html
Please submit your patches to our Bugzilla: http://bugs.clamav.net


[Clamav-devel] build & debugging ex1.c

2008-12-04 Thread Thomasz Blaszczyk
Hi,
I just want to debug ex1.c in Code::Blocks IDE,
But it fails, Please have look at my screenshot: http://omploader.org/vem1m

What I did:
I've created new folder  'ex1' and I've copied ex1.c file to this folder.
Next I've moved all files from libclamav to this folder.
I change only one line in ex1.c:
#include 
to
#include "clamav.h"

When I build it fails, saying:

obj/Debug/ex1.o||In function `main':|
/home/tomb/projects/aau/virus_scanner/codeblocks/ex1/ex1.c|64|undefined
reference to `cl_retdbdir'|
/home/tomb/projects/aau/virus_scanner/codeblocks/ex1/ex1.c|64|undefined
reference to `cl_load'|
/home/tomb/projects/aau/virus_scanner/codeblocks/ex1/ex1.c|65|undefined
reference to `cl_strerror'|
/home/tomb/projects/aau/virus_scanner/codeblocks/ex1/ex1.c|73|undefined
reference to `cl_build'|
/home/tomb/projects/aau/virus_scanner/codeblocks/ex1/ex1.c|74|undefined
reference to `cl_strerror'|
/home/tomb/projects/aau/virus_scanner/codeblocks/ex1/ex1.c|75|undefined
reference to `cl_free'|
/home/tomb/projects/aau/virus_scanner/codeblocks/ex1/ex1.c|93|undefined
reference to `cl_scandesc'|
/home/tomb/projects/aau/virus_scanner/codeblocks/ex1/ex1.c|99|undefined
reference to `cl_strerror'|
/home/tomb/projects/aau/virus_scanner/codeblocks/ex1/ex1.c|100|undefined
reference to `cl_free'|
/home/tomb/projects/aau/virus_scanner/codeblocks/ex1/ex1.c|112|undefined
reference to `cl_free'|
||=== Build finished: 10 errors, 0 warnings ===|


What am I missing. I have expected that steps I did will succeed.  Can
anyone help?  .I am new to linux compilers. I would like to measure
performance for BM and AC algorithms.
Thanks in advance.
Tom
___
http://lurker.clamav.net/list/clamav-devel.html
Please submit your patches to our Bugzilla: http://bugs.clamav.net


Re: [Clamav-devel] clamAV scanning algorithm

2008-12-04 Thread Török Edwin
On 2008-12-04 00:41, Thomasz Blaszczyk wrote:
> Thank you for reply,
>
> Török Edwin, Very, very good web seminar!
>   

Thanks

> I have 2 more questions:
>
> 1) I'd like to measure & compare performance of AC & BM algorithms.
>
> clamscan displays in 'scan summary' a 'time'. Does this time include
> disc access, signature tree building in AC(phase1) or BM
> Just wonder If I can use this time or I should figure out new timestamps.
>   

It includes all of the above: it is the time from the launch of clamscan
(after options are parsed), till the scan is complete.

Best regards,
--Edwin
___
http://lurker.clamav.net/list/clamav-devel.html
Please submit your patches to our Bugzilla: http://bugs.clamav.net