User:Durgaprasad karnam/sandbox

Test page

Advanced driver assistance systems

Coding Standards
 * Defines are ALL_CAPITALS with underscores as word separators.
 * Global variables start with ‘g_’.
 * Pointers start with ‘p_’. – Must?
 * Static variables start with ‘s_’. Its too much?
 * Typedefs end with ‘_t’.

Profiling tools GProf


 * 1) Numbered list item Write a program


 * 1) include 

int array_sum(int *array,int size) {	int i;	int sum = 0;

for (i=0;i<size;i++) {		sum = sum+array[i]; }	return sum; }

int main {	int a[10000] = {[0 ... 9]=10};	int b=0;

b = array_sum(a,sizeof(a)/sizeof(int)); //printf("b:%d\n",b);

return 0; }


 * 1) Numbered list item Compile with –pg option Gcc –pg test.c
 * 2) Numbered list item Run the exe – this will generate gmon.out
 * 3) Numbered list item Run ‘gprof’ Gprof a.exe gmon.out This will print the results on the console.