Deleted Added
full compact
subr_lock.c (167012) subr_lock.c (168315)
1/*-
2 * Copyright (c) 2006 John Baldwin <jhb@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

28 */
29
30/*
31 * This module holds the global variables and functions used to maintain
32 * lock_object structures.
33 */
34
35#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2006 John Baldwin <jhb@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

28 */
29
30/*
31 * This module holds the global variables and functions used to maintain
32 * lock_object structures.
33 */
34
35#include <sys/cdefs.h>
36__FBSDID("$FreeBSD: head/sys/kern/subr_lock.c 167012 2007-02-26 08:26:44Z kmacy $");
36__FBSDID("$FreeBSD: head/sys/kern/subr_lock.c 168315 2007-04-03 18:36:27Z kmacy $");
37
38#include "opt_ddb.h"
39#include "opt_mprof.h"
40
41#include <sys/param.h>
42#include <sys/systm.h>
43#include <sys/ktr.h>
44#include <sys/linker_set.h>

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

249}
250#endif
251
252#ifdef LOCK_PROFILING
253void _lock_profile_obtain_lock_success(struct lock_object *lo, int contested, uint64_t waittime, const char *file, int line)
254{
255 struct lock_profile_object *l = &lo->lo_profile_obj;
256
37
38#include "opt_ddb.h"
39#include "opt_mprof.h"
40
41#include <sys/param.h>
42#include <sys/systm.h>
43#include <sys/ktr.h>
44#include <sys/linker_set.h>

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

249}
250#endif
251
252#ifdef LOCK_PROFILING
253void _lock_profile_obtain_lock_success(struct lock_object *lo, int contested, uint64_t waittime, const char *file, int line)
254{
255 struct lock_profile_object *l = &lo->lo_profile_obj;
256
257 /* don't reset the timer when/if recursing */
258 if (l->lpo_acqtime == 0) {
259 lo->lo_profile_obj.lpo_contest_holding = 0;
260
261 if (contested)
262 lo->lo_profile_obj.lpo_contest_locking++;
257 lo->lo_profile_obj.lpo_contest_holding = 0;
263
258
264 l->lpo_filename = file;
265 l->lpo_lineno = line;
266 l->lpo_acqtime = nanoseconds();
267 if (waittime && (l->lpo_acqtime > waittime))
268 l->lpo_waittime = l->lpo_acqtime - waittime;
269 else
270 l->lpo_waittime = 0;
271 }
259 if (contested)
260 lo->lo_profile_obj.lpo_contest_locking++;
261
262 l->lpo_filename = file;
263 l->lpo_lineno = line;
264 l->lpo_acqtime = nanoseconds();
265 if (waittime && (l->lpo_acqtime > waittime))
266 l->lpo_waittime = l->lpo_acqtime - waittime;
267 else
268 l->lpo_waittime = 0;
272}
273
274void _lock_profile_release_lock(struct lock_object *lo)
275{
276 struct lock_profile_object *l = &lo->lo_profile_obj;
277
278 if (l->lpo_acqtime && !(lo->lo_flags & LO_NOPROFILE)) {
279 const char *unknown = "(unknown)";

--- 82 unchanged lines hidden ---
269}
270
271void _lock_profile_release_lock(struct lock_object *lo)
272{
273 struct lock_profile_object *l = &lo->lo_profile_obj;
274
275 if (l->lpo_acqtime && !(lo->lo_flags & LO_NOPROFILE)) {
276 const char *unknown = "(unknown)";

--- 82 unchanged lines hidden ---