Print this page
6375 Add native name demangling support
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Richard Lowe <richlowe@richlowe.net>

*** 20,33 **** */ /* * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ - #pragma ident "%Z%%M% %I% %E% SMI" - /* * All routines in this file are for processing new-style, *versioned* * mon.out format. Together with rdelf.c, lookup.c and profv.h, these * form the complete set of files to profile new-style mon.out files. */ --- 20,33 ---- */ /* * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * + * Copyright 2018, Joyent, Inc. */ /* * All routines in this file are for processing new-style, *versioned* * mon.out format. Together with rdelf.c, lookup.c and profv.h, these * form the complete set of files to profile new-style mon.out files. */
*** 72,82 **** nbp = namebuf; nbe = namebuf + namebuf_sz; for (i = 0; i < total_funcs; i++) { ! if ((p = conv_demangle_name(profsym[i].name)) == NULL) continue; namelen = strlen(p); if ((nbp + namelen + 1) > nbe) { namebuf_sz += BUCKET_SZ; --- 72,83 ---- nbp = namebuf; nbe = namebuf + namebuf_sz; for (i = 0; i < total_funcs; i++) { ! p = conv_demangle_name(profsym[i].name); ! if (p == profsym[i].name) continue; namelen = strlen(p); if ((nbp + namelen + 1) > nbe) { namebuf_sz += BUCKET_SZ;
*** 95,104 **** --- 96,106 ---- (void) strcpy(nbp, p); profsym[i].demangled_name = nbp; nbp += namelen + 1; cur_len += namelen + 1; + free((void *)p); } } int cmp_by_time(const void *arg1, const void *arg2)