Changeset 134408c


Ignore:
Timestamp:
05/28/15 08:18:21 (9 years ago)
Author:
Hal Finkel <hfinkel@…>
Branches:
master
Children:
69850c8
Parents:
0a0ef57
git-author:
Hal Finkel <hfinkel@…> (05/28/15 08:18:21)
git-committer:
Hal Finkel <hfinkel@…> (05/28/15 08:18:21)
Message:

print tid; break on UNW_ENOINFO

File:
1 edited

Legend:

Unmodified
Added
Removed
  • memlog.c

    r0a0ef57 r134408c  
    88#include <string.h> 
    99 
     10#include <sys/syscall.h> 
    1011#include <sys/time.h> 
    1112#include <sys/resource.h> 
     
    5455  } 
    5556 
    56   fprintf(log_file, "\t%ld.%06ld %ld", usage.ru_utime.tv_sec, 
    57           usage.ru_utime.tv_usec, usage.ru_maxrss); 
     57  fprintf(log_file, "\t%ld.%06ld %ld %ld", usage.ru_utime.tv_sec, 
     58          usage.ru_utime.tv_usec, usage.ru_maxrss, syscall(SYS_gettid)); 
    5859 
    5960  int r; 
     
    8687 
    8788        if ((r = unw_get_proc_info_by_ip(unw_local_addr_space, pc, &pip, NULL))) { 
     89          if (r == -UNW_ENOINFO) 
     90            break; // the cursor is now invalid; must break here. 
     91 
    8892          fprintf(stderr, "unw_get_proc_info_by_ip failed: %s [%d]\n", 
    8993                  unw_strerror(r), r); 
     
    9195        } 
    9296      } else { 
     97        if (r == -UNW_ENOINFO) 
     98          break; // the cursor is now invalid; must break here. 
     99 
    93100        fprintf(stderr, "unw_get_proc_info failed: %s [%d]\n", 
    94101                unw_strerror(r), r); 
     
    109116  } 
    110117 
    111   if (r < 0) 
     118  if (r < 0 && r != -UNW_ENOINFO) 
    112119    fprintf(stderr, "unw_step failed: %s [%d]\n", 
    113120            unw_strerror(r), r); 
Note: See TracChangeset for help on using the changeset viewer.