Deleted Added
full compact
hwpmc_logging.c (184801) hwpmc_logging.c (185363)
1/*-
2 * Copyright (c) 2005-2007 Joseph Koshy
3 * Copyright (c) 2007 The FreeBSD Foundation
4 * All rights reserved.
5 *
6 * Portions of this software were developed by A. Joseph Koshy under
7 * sponsorship from the FreeBSD Foundation and Google, Inc.
8 *

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

29 *
30 */
31
32/*
33 * Logging code for hwpmc(4)
34 */
35
36#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2005-2007 Joseph Koshy
3 * Copyright (c) 2007 The FreeBSD Foundation
4 * All rights reserved.
5 *
6 * Portions of this software were developed by A. Joseph Koshy under
7 * sponsorship from the FreeBSD Foundation and Google, Inc.
8 *

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

29 *
30 */
31
32/*
33 * Logging code for hwpmc(4)
34 */
35
36#include <sys/cdefs.h>
37__FBSDID("$FreeBSD: head/sys/dev/hwpmc/hwpmc_logging.c 184801 2008-11-09 17:07:52Z jkoshy $");
37__FBSDID("$FreeBSD: head/sys/dev/hwpmc/hwpmc_logging.c 185363 2008-11-27 09:00:47Z jkoshy $");
38
39#include <sys/param.h>
40#include <sys/file.h>
41#include <sys/kernel.h>
42#include <sys/kthread.h>
43#include <sys/lock.h>
44#include <sys/module.h>
45#include <sys/mutex.h>

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

282 mtx_unlock_spin(&po->po_mtx);
283
284 /* wakeup any processes waiting for a FLUSH */
285 if (po->po_flags & PMC_PO_IN_FLUSH) {
286 po->po_flags &= ~PMC_PO_IN_FLUSH;
287 wakeup_one(po->po_kthread);
288 }
289
38
39#include <sys/param.h>
40#include <sys/file.h>
41#include <sys/kernel.h>
42#include <sys/kthread.h>
43#include <sys/lock.h>
44#include <sys/module.h>
45#include <sys/mutex.h>

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

282 mtx_unlock_spin(&po->po_mtx);
283
284 /* wakeup any processes waiting for a FLUSH */
285 if (po->po_flags & PMC_PO_IN_FLUSH) {
286 po->po_flags &= ~PMC_PO_IN_FLUSH;
287 wakeup_one(po->po_kthread);
288 }
289
290 (void) msleep(po, &pmc_kthread_mtx, PWAIT,
291 "pmcloop", 0);
290
291 (void) msleep(po, &pmc_kthread_mtx,
292 PWAIT, "pmcloop", 0);
292 continue;
293 }
294
295 TAILQ_REMOVE(&po->po_logbuffers, lb, plb_next);
296 mtx_unlock_spin(&po->po_mtx);
297 }
298
299 mtx_unlock(&pmc_kthread_mtx);

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

538/*
539 * Configure a log file for pmc owner 'po'.
540 *
541 * Parameter 'logfd' is a file handle referencing an open file in the
542 * owner process. This file needs to have been opened for writing.
543 */
544
545int
293 continue;
294 }
295
296 TAILQ_REMOVE(&po->po_logbuffers, lb, plb_next);
297 mtx_unlock_spin(&po->po_mtx);
298 }
299
300 mtx_unlock(&pmc_kthread_mtx);

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

539/*
540 * Configure a log file for pmc owner 'po'.
541 *
542 * Parameter 'logfd' is a file handle referencing an open file in the
543 * owner process. This file needs to have been opened for writing.
544 */
545
546int
546pmclog_configure_log(struct pmc_owner *po, int logfd)
547pmclog_configure_log(struct pmc_mdep *md, struct pmc_owner *po, int logfd)
547{
548 int error;
549 struct proc *p;
550
551 PMCDBG(LOG,CFG,1, "config po=%p logfd=%d", po, logfd);
552
553 p = po->po_owner;
554

--- 450 unchanged lines hidden ---
548{
549 int error;
550 struct proc *p;
551
552 PMCDBG(LOG,CFG,1, "config po=%p logfd=%d", po, logfd);
553
554 p = po->po_owner;
555

--- 450 unchanged lines hidden ---