Deleted Added
sdiff udiff text old ( 284085 ) new ( 296816 )
full compact
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 10 unchanged lines hidden (view full) ---

19 * CDDL HEADER END
20 */
21
22/*
23 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
24 */
25/*
26 * Copyright (c) 2013, Joyent, Inc. All rights reserved.
27 */
28
29#include <sys/types.h>
30#ifdef illumos
31#include <sys/modctl.h>
32#include <sys/kobj.h>
33#include <sys/kobj_impl.h>
34#include <sys/sysmacros.h>

--- 681 unchanged lines hidden (view full) ---

716
717 if (arg.dpa_count == 0) {
718 dt_dprintf("no ctf data present\n");
719 dt_proc_unlock(dtp, p);
720 dt_proc_release(dtp, p);
721 return (dt_set_errno(dtp, EDT_CANTLOAD));
722 }
723
724 dmp->dm_libctfp = malloc(sizeof (ctf_file_t *) * arg.dpa_count);
725 if (dmp->dm_libctfp == NULL) {
726 dt_proc_unlock(dtp, p);
727 dt_proc_release(dtp, p);
728 return (dt_set_errno(dtp, EDT_NOMEM));
729 }
730 bzero(dmp->dm_libctfp, sizeof (ctf_file_t *) * arg.dpa_count);
731
732 dmp->dm_libctfn = malloc(sizeof (char *) * arg.dpa_count);
733 if (dmp->dm_libctfn == NULL) {
734 free(dmp->dm_libctfp);
735 dt_proc_unlock(dtp, p);
736 dt_proc_release(dtp, p);
737 return (dt_set_errno(dtp, EDT_NOMEM));
738 }
739 bzero(dmp->dm_libctfn, sizeof (char *) * arg.dpa_count);
740
741 dmp->dm_nctflibs = arg.dpa_count;
742
743 arg.dpa_count = 0;
744 if (Pobject_iter_resolved(p, dt_module_load_proc_build, &arg) != 0) {
745 dt_proc_unlock(dtp, p);
746 dt_module_unload(dtp, dmp);
747 dt_proc_release(dtp, p);

--- 64 unchanged lines hidden (view full) ---

812 * use element indices instead of pointers and zero is our sentinel.
813 */
814 dmp->dm_nsymelems =
815 dmp->dm_symtab.cts_size / dmp->dm_symtab.cts_entsize;
816
817 dmp->dm_nsymbuckets = _dtrace_strbuckets;
818 dmp->dm_symfree = 1; /* first free element is index 1 */
819
820 dmp->dm_symbuckets = malloc(sizeof (uint_t) * dmp->dm_nsymbuckets);
821 dmp->dm_symchains = malloc(sizeof (dt_sym_t) * dmp->dm_nsymelems + 1);
822
823 if (dmp->dm_symbuckets == NULL || dmp->dm_symchains == NULL) {
824 dt_module_unload(dtp, dmp);
825 return (dt_set_errno(dtp, EDT_NOMEM));
826 }
827
828 bzero(dmp->dm_symbuckets, sizeof (uint_t) * dmp->dm_nsymbuckets);
829 bzero(dmp->dm_symchains, sizeof (dt_sym_t) * dmp->dm_nsymelems + 1);
830
831 /*
832 * Iterate over the symbol table data buffer and insert each symbol
833 * name into the name hash if the name and type are valid. Then
834 * allocate the address map, fill it in, and sort it.
835 */
836 dmp->dm_asrsv = dmp->dm_ops->do_syminit(dmp);
837
838 dt_dprintf("hashed %s [%s] (%u symbols)\n",

--- 947 unchanged lines hidden ---