Print this page
libconv

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/sgs/prof/common/profv.c
          +++ new/usr/src/cmd/sgs/prof/common/profv.c
↓ open down ↓ 66 lines elided ↑ open up ↑
  67   67          if ((namebuf = malloc(namebuf_sz)) == NULL) {
  68   68                  (void) fprintf(stderr, "%s: can't allocate %d bytes\n",
  69   69                      cmdname, namebuf_sz);
  70   70                  exit(ERR_MEMORY);
  71   71          }
  72   72  
  73   73          nbp = namebuf;
  74   74          nbe = namebuf + namebuf_sz;
  75   75  
  76   76          for (i = 0; i < total_funcs; i++) {
  77      -                if ((p = conv_demangle_name(profsym[i].name)) == NULL)
       77 +                p = conv_demangle_name(profsym[i].name);
       78 +                if (p == profsym[i].name)
  78   79                          continue;
  79   80  
  80   81                  namelen = strlen(p);
  81   82                  if ((nbp + namelen + 1) > nbe) {
  82   83                          namebuf_sz += BUCKET_SZ;
  83   84                          namebuf = realloc(namebuf, namebuf_sz);
  84   85                          if (namebuf == NULL) {
  85   86                                  (void) fprintf(stderr,
  86   87                                      "%s: can't alloc %d bytes\n",
  87   88                                      cmdname, BUCKET_SZ);
↓ open down ↓ 2 lines elided ↑ open up ↑
  90   91  
  91   92                          nbp = namebuf + cur_len;
  92   93                          nbe = namebuf + namebuf_sz;
  93   94                  }
  94   95  
  95   96                  (void) strcpy(nbp, p);
  96   97                  profsym[i].demangled_name = nbp;
  97   98  
  98   99                  nbp += namelen + 1;
  99  100                  cur_len += namelen + 1;
      101 +                free((void *)p);
 100  102          }
 101  103  }
 102  104  
 103  105  int
 104  106  cmp_by_time(const void *arg1, const void *arg2)
 105  107  {
 106  108          profrec_t *a = (profrec_t *)arg1;
 107  109          profrec_t *b = (profrec_t *)arg2;
 108  110  
 109  111          if (a->percent_time > b->percent_time)
↓ open down ↓ 805 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX