Deleted Added
full compact
fasttrap.c (270834) fasttrap.c (275562)
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

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

15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 *
21 * Portions Copyright 2010 The FreeBSD Foundation
22 *
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

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

15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 *
21 * Portions Copyright 2010 The FreeBSD Foundation
22 *
23 * $FreeBSD: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c 270834 2014-08-30 03:10:55Z mjg $
23 * $FreeBSD: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c 275562 2014-12-06 09:38:28Z delphij $
24 */
25
26/*
27 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
28 * Use is subject to license terms.
29 */
30
31/*

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

2478 "fasttrap-hash-size", FASTTRAP_TPOINTS_DEFAULT_SIZE);
2479#else
2480 nent = FASTTRAP_TPOINTS_DEFAULT_SIZE;
2481#endif
2482
2483 if (nent == 0 || nent > 0x1000000)
2484 nent = FASTTRAP_TPOINTS_DEFAULT_SIZE;
2485
24 */
25
26/*
27 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
28 * Use is subject to license terms.
29 */
30
31/*

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

2478 "fasttrap-hash-size", FASTTRAP_TPOINTS_DEFAULT_SIZE);
2479#else
2480 nent = FASTTRAP_TPOINTS_DEFAULT_SIZE;
2481#endif
2482
2483 if (nent == 0 || nent > 0x1000000)
2484 nent = FASTTRAP_TPOINTS_DEFAULT_SIZE;
2485
2486 if ((nent & (nent - 1)) == 0)
2486 if (ISP2(nent))
2487 fasttrap_tpoints.fth_nent = nent;
2488 else
2489 fasttrap_tpoints.fth_nent = 1 << fasttrap_highbit(nent);
2490 ASSERT(fasttrap_tpoints.fth_nent > 0);
2491 fasttrap_tpoints.fth_mask = fasttrap_tpoints.fth_nent - 1;
2492 fasttrap_tpoints.fth_table = kmem_zalloc(fasttrap_tpoints.fth_nent *
2493 sizeof (fasttrap_bucket_t), KM_SLEEP);
2494#if !defined(sun)
2495 for (i = 0; i < fasttrap_tpoints.fth_nent; i++)
2496 mutex_init(&fasttrap_tpoints.fth_table[i].ftb_mtx,
2497 "tracepoints bucket mtx", MUTEX_DEFAULT, NULL);
2498#endif
2499
2500 /*
2501 * ... and the providers hash table...
2502 */
2503 nent = FASTTRAP_PROVIDERS_DEFAULT_SIZE;
2487 fasttrap_tpoints.fth_nent = nent;
2488 else
2489 fasttrap_tpoints.fth_nent = 1 << fasttrap_highbit(nent);
2490 ASSERT(fasttrap_tpoints.fth_nent > 0);
2491 fasttrap_tpoints.fth_mask = fasttrap_tpoints.fth_nent - 1;
2492 fasttrap_tpoints.fth_table = kmem_zalloc(fasttrap_tpoints.fth_nent *
2493 sizeof (fasttrap_bucket_t), KM_SLEEP);
2494#if !defined(sun)
2495 for (i = 0; i < fasttrap_tpoints.fth_nent; i++)
2496 mutex_init(&fasttrap_tpoints.fth_table[i].ftb_mtx,
2497 "tracepoints bucket mtx", MUTEX_DEFAULT, NULL);
2498#endif
2499
2500 /*
2501 * ... and the providers hash table...
2502 */
2503 nent = FASTTRAP_PROVIDERS_DEFAULT_SIZE;
2504 if ((nent & (nent - 1)) == 0)
2504 if (ISP2(nent))
2505 fasttrap_provs.fth_nent = nent;
2506 else
2507 fasttrap_provs.fth_nent = 1 << fasttrap_highbit(nent);
2508 ASSERT(fasttrap_provs.fth_nent > 0);
2509 fasttrap_provs.fth_mask = fasttrap_provs.fth_nent - 1;
2510 fasttrap_provs.fth_table = kmem_zalloc(fasttrap_provs.fth_nent *
2511 sizeof (fasttrap_bucket_t), KM_SLEEP);
2512#if !defined(sun)

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

2532 return (ret);
2533 }
2534
2535
2536 /*
2537 * ... and the procs hash table.
2538 */
2539 nent = FASTTRAP_PROCS_DEFAULT_SIZE;
2505 fasttrap_provs.fth_nent = nent;
2506 else
2507 fasttrap_provs.fth_nent = 1 << fasttrap_highbit(nent);
2508 ASSERT(fasttrap_provs.fth_nent > 0);
2509 fasttrap_provs.fth_mask = fasttrap_provs.fth_nent - 1;
2510 fasttrap_provs.fth_table = kmem_zalloc(fasttrap_provs.fth_nent *
2511 sizeof (fasttrap_bucket_t), KM_SLEEP);
2512#if !defined(sun)

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

2532 return (ret);
2533 }
2534
2535
2536 /*
2537 * ... and the procs hash table.
2538 */
2539 nent = FASTTRAP_PROCS_DEFAULT_SIZE;
2540 if ((nent & (nent - 1)) == 0)
2540 if (ISP2(nent))
2541 fasttrap_procs.fth_nent = nent;
2542 else
2543 fasttrap_procs.fth_nent = 1 << fasttrap_highbit(nent);
2544 ASSERT(fasttrap_procs.fth_nent > 0);
2545 fasttrap_procs.fth_mask = fasttrap_procs.fth_nent - 1;
2546 fasttrap_procs.fth_table = kmem_zalloc(fasttrap_procs.fth_nent *
2547 sizeof (fasttrap_bucket_t), KM_SLEEP);
2548#if !defined(sun)

--- 180 unchanged lines hidden ---
2541 fasttrap_procs.fth_nent = nent;
2542 else
2543 fasttrap_procs.fth_nent = 1 << fasttrap_highbit(nent);
2544 ASSERT(fasttrap_procs.fth_nent > 0);
2545 fasttrap_procs.fth_mask = fasttrap_procs.fth_nent - 1;
2546 fasttrap_procs.fth_table = kmem_zalloc(fasttrap_procs.fth_nent *
2547 sizeof (fasttrap_bucket_t), KM_SLEEP);
2548#if !defined(sun)

--- 180 unchanged lines hidden ---