diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-07-05 20:45:55 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-07-05 20:45:55 +0000 |
commit | 23b1172e7e04fd5a7b2b5db35a5cd8c06526b82f (patch) | |
tree | 8573bdf5d9041eb9faf2e0ca557243580f3f213f /pjsip-apps | |
parent | 2df60064afb5cb53076764d39badfd64939833b1 (diff) |
Some improvements in footprint generation
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@586 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip-apps')
-rw-r--r-- | pjsip-apps/build/Footprint.mak | 2 | ||||
-rw-r--r-- | pjsip-apps/build/get-footprint.py | 40 | ||||
-rw-r--r-- | pjsip-apps/src/samples/footprint.c | 37 |
3 files changed, 65 insertions, 14 deletions
diff --git a/pjsip-apps/build/Footprint.mak b/pjsip-apps/build/Footprint.mak index b3dd1ed3..735aef25 100644 --- a/pjsip-apps/build/Footprint.mak +++ b/pjsip-apps/build/Footprint.mak @@ -49,3 +49,5 @@ all: clean: rm -f $(EXE) +print_name: + @echo $(MACHINE_NAME) $(OS_NAME) $(CC_NAME) `$(CC_NAME) -dumpversion` diff --git a/pjsip-apps/build/get-footprint.py b/pjsip-apps/build/get-footprint.py index d3ba4300..befa27d7 100644 --- a/pjsip-apps/build/get-footprint.py +++ b/pjsip-apps/build/get-footprint.py @@ -11,7 +11,10 @@ import time compile_flags1 = [ # Base - ['BASE', 'Minimum PJLIB only'], + ['BASE', 'Empty application size'], + ['', 'Subtotal: Empty application size'], + + ['HAS_PJLIB', 'Minimum PJLIB only'], # Subtotal ['', 'Subtotal'], @@ -26,19 +29,23 @@ compile_flags1 = [ compile_flags = [ # Base - ['BASE', 'PJLIB (pool, data structures, hash tables, ioqueue, timer heap)'], + ['BASE', 'Empty application size'], + ['', 'Subtotal: empty application size on this platform'], + + ['HAS_PJLIB', 'PJLIB (pool, data structures, hash tables, ioqueue, socket, timer heap, etc.)'], ['', 'Subtotal: Minimum PJLIB application size (linked with OS libraries)'], # PJLIB-UTIL ['HAS_PJLIB_STUN', 'PJLIB-UTIL STUN client'], ['HAS_PJLIB_GETOPT', 'PJLIB-UTIL getopt() functionality'], - ['HAS_PJLIB_XML', 'PJLIB-UTIL XML parsing and API'], + ['HAS_PJLIB_SCANNER', 'PJLIB-UTIL text scanner (needed by SIP parser)'], + ['HAS_PJLIB_XML', 'PJLIB-UTIL tiny XML (parsing and API) (needs text scanner)'], # PJSIP - ['HAS_PJSIP_CORE', 'PJSIP Core (endpoint, transport manager, parser, message elements, etc.)'], + ['HAS_PJSIP_CORE', 'PJSIP Core (endpoint, transport manager, parser, message elements, module mgmt, etc.)'], ['HAS_PJSIP_UDP_TRANSPORT', 'PJSIP UDP transport'], ['', 'Subtotal: A very minimum SIP application (parsing, UDP transport+STUN, no transaction)'], - + ['HAS_PJSIP_TCP_TRANSPORT', 'PJSIP TCP transport'], ['HAS_PJSIP_INFO', 'PJSIP INFO support (RFC 2976) (no special treatment, thus the zero size)'], ['HAS_PJSIP_TRANSACTION', 'PJSIP transaction and stateful API'], @@ -152,19 +159,27 @@ def print_html_report(filename): # Get Revision info. f = os.popen('svn info | grep Revision') - revision = f.readline() - + revision = f.readline().split()[1] + + # Get Machine, OS, and CC name + f = os.popen('make -f Footprint.mak print_name') + names = f.readline().split() + m = names[0] + o = names[1] + cc = names[2] + cc_ver = names[3] + output.write('<HTML><HEAD>\n'); - output.write(' <TITLE>PJSIP and PJMEDIA footprint report (' + revision + ')</TITLE>\n') + output.write(' <TITLE>PJSIP and PJMEDIA footprint report for ' + o + '/' + m + ' (r' + revision + ')</TITLE>\n') output.write(' <LINK href="/style/style.css" type="text/css" rel="stylesheet">\n') output.write('</HEAD>\n'); output.write('<BODY bgcolor="white">\n'); - output.write('<!-- #include virtual="/header.html" -->') + output.write('<!--#include virtual="/header.html" -->') - output.write(' <H1>PJSIP and PJMEDIA footprint report (' + revision + ')</H1>\n') + output.write(' <H1>PJSIP and PJMEDIA footprint report (r' + revision + ')</H1>\n') output.write('Auto-generated by pjsip-apps/build/get-footprint.py\n') output.write('<p>Date: ' + time.asctime() + '<BR>\n') - output.write(revision + '</p>\n\n') + output.write('Revision: r' + revision + '</p>\n\n') output.write('<HR>\n') output.write('\n') @@ -179,6 +194,7 @@ def print_html_report(filename): for l in s: output.write(l + '<BR>\n') output.write('</tt>\n') + output.write('<p>Using ' + cc + ' version ' + cc_ver +'</p>\n') # user.mak output.write('\n<H3>user.mak</H3>\n') @@ -232,7 +248,7 @@ def print_html_report(filename): output.write('</TR>\n') output.write('</TABLE>\n') - output.write('<!-- #include virtual="/footer.html" -->') + output.write('<!--#include virtual="/footer.html" -->') output.write('</BODY>\n') output.write('</HTML>\n') diff --git a/pjsip-apps/src/samples/footprint.c b/pjsip-apps/src/samples/footprint.c index 9926d6ab..6cb630e2 100644 --- a/pjsip-apps/src/samples/footprint.c +++ b/pjsip-apps/src/samples/footprint.c @@ -32,13 +32,16 @@ #include <pjmedia-codec.h> #include <pjlib-util.h> #include <pjlib.h> - +#include <stdlib.h> /* All flags: */ #if 0 +#define HAS_PJLIB + #define HAS_PJLIB_STUN #define HAS_PJLIB_GETOPT #define HAS_PJLIB_XML +#define HAS_PJLIB_SCANNER #define HAS_PJSIP_CORE #define HAS_PJSIP_UDP_TRANSPORT @@ -81,7 +84,11 @@ int dummy_function() { pj_caching_pool cp; - + + sprintf(NULL, "%d", 0); + rand(); + +#ifdef HAS_PJLIB pj_init(); pj_caching_pool_init(&cp, NULL, 0); pj_array_erase(NULL, 0, 0, 0); @@ -93,6 +100,7 @@ int dummy_function() pj_ioqueue_register_sock(NULL, NULL, 0, NULL, NULL, NULL); pj_pool_alloc(NULL, 0); pj_timer_heap_create(NULL, 0, NULL); +#endif #ifdef HAS_PJLIB_STUN pj_stun_get_mapped_addr(&cp.factory, 0, NULL, NULL, 80, NULL, 80, NULL); @@ -116,6 +124,31 @@ int dummy_function() pj_xml_find(NULL, NULL, NULL, NULL); #endif +#ifdef HAS_PJLIB_SCANNER + pj_cis_buf_init(NULL); + pj_cis_init(NULL, NULL); + pj_cis_dup(NULL, NULL); + pj_cis_add_alpha(NULL); + pj_cis_add_str(NULL, NULL); + + pj_scan_init(NULL, NULL, 0, 0, NULL); + pj_scan_fini(NULL); + pj_scan_peek(NULL, NULL, NULL); + pj_scan_peek_n(NULL, 0, NULL); + pj_scan_peek_until(NULL, NULL, NULL); + pj_scan_get(NULL, NULL, NULL); + pj_scan_get_unescape(NULL, NULL, NULL); + pj_scan_get_quote(NULL, 0, 0, NULL); + pj_scan_get_n(NULL, 0, NULL); + pj_scan_get_char(NULL); + pj_scan_get_until(NULL, NULL, NULL); + pj_scan_strcmp(NULL, NULL, 0); + pj_scan_stricmp(NULL, NULL, 0); + pj_scan_stricmp_alnum(NULL, NULL, 0); + pj_scan_get_newline(NULL); + pj_scan_restore_state(NULL, NULL); +#endif + #ifdef HAS_PJSIP_CORE pjsip_endpt_create(NULL, NULL, NULL); |