[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] failed to get gcov result for libelf_* files



Hi all:
    I'm backporting gcov-related patches(68ca0bc4ba -> 922153cd37) to xen 
4.1.2, but encountered with several problems, one problem is as follows:
    1) although all the files are gathered into gcov_info_list correctly by 
__gcov_init(), but when we call write_gcov(), 3 gcov_info seem had been broken.
       xen/common/libelf/libelf-tools.c
       xen/common/libelf/libelf-loader.c
       xen/common/libelf/libelf-dominfo.c

    info->filename of theis are NULL, thus when we call write_gcov() -> 
write_string() -> strlen(), segment fault and kernel panic occurs.

    2)  even if we fixed the above problem by:
        If ( !info->filename )
            continue;
       inside write_gcov(),  I found that the info next to the problem one is 
null, thus, files after the problem one all get skipped. ( we only get 200 gcda 
files although we have 262 source files in total)

    3) I 'fixed' this by modify __gcov_init():
       void __gcov_init(struct gcov_info *info)
       {
           /* add new profiling data structure to list */
      +    n_info_list ++;
      +    if (n_info_list >= 61 && n_info_list <=63) {
      +       printk("skip:%d\n", n_info_list);
      +       return;
      +    }
           info->next = info_list;
           info_list = info;
       }
       Then the files after these 3 files are not affected. We got 259 gcda 
files then.

    But, my solution obviously is the not the right solution, what's special 
about the 3 files? Why are their gcov_info get modified(filename changed to 
NULL) between __gcov_init() and write_gcov()? What's your suggestion to debug 
the problem?

    Thanks in advance.

   Oscar.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.