dtrace_subr.c (257417) | dtrace_subr.c (268600) |
---|---|
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, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. 8 * --- 5 unchanged lines hidden (view full) --- 14 * When distributing Covered Code, include this CDDL HEADER in each 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 * | 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, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. 8 * --- 5 unchanged lines hidden (view full) --- 14 * When distributing Covered Code, include this CDDL HEADER in each 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 * |
22 * $FreeBSD: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c 257417 2013-10-31 02:35:00Z markj $ | 22 * $FreeBSD: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c 268600 2014-07-14 04:38:17Z markj $ |
23 * 24 */ 25/* 26 * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 27 * Use is subject to license terms. 28 */ 29 30/* --- 426 unchanged lines hidden (view full) --- 457{ 458 struct timespec current_time; 459 460 dtrace_getnanotime(¤t_time); 461 462 return (current_time.tv_sec * 1000000000ULL + current_time.tv_nsec); 463} 464 | 23 * 24 */ 25/* 26 * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 27 * Use is subject to license terms. 28 */ 29 30/* --- 426 unchanged lines hidden (view full) --- 457{ 458 struct timespec current_time; 459 460 dtrace_getnanotime(¤t_time); 461 462 return (current_time.tv_sec * 1000000000ULL + current_time.tv_nsec); 463} 464 |
465/* Function to handle DTrace traps during probes. See amd64/amd64/trap.c */ | 465/* 466 * Function to handle DTrace traps during probes. See amd64/amd64/exception.S. 467 */ |
466int | 468int |
467dtrace_trap(struct trapframe *frame, u_int type) | 469dtrace_trap(struct trapframe *frame) |
468{ 469 /* 470 * A trap can occur while DTrace executes a probe. Before 471 * executing the probe, DTrace blocks re-scheduling and sets | 470{ 471 /* 472 * A trap can occur while DTrace executes a probe. Before 473 * executing the probe, DTrace blocks re-scheduling and sets |
472 * a flag in it's per-cpu flags to indicate that it doesn't | 474 * a flag in its per-cpu flags to indicate that it doesn't |
473 * want to fault. On returning from the probe, the no-fault 474 * flag is cleared and finally re-scheduling is enabled. 475 * 476 * Check if DTrace has enabled 'no-fault' mode: | 475 * want to fault. On returning from the probe, the no-fault 476 * flag is cleared and finally re-scheduling is enabled. 477 * 478 * Check if DTrace has enabled 'no-fault' mode: |
477 * | |
478 */ 479 if ((cpu_core[curcpu].cpuc_dtrace_flags & CPU_DTRACE_NOFAULT) != 0) { 480 /* 481 * There are only a couple of trap types that are expected. 482 * All the rest will be handled in the usual way. 483 */ | 479 */ 480 if ((cpu_core[curcpu].cpuc_dtrace_flags & CPU_DTRACE_NOFAULT) != 0) { 481 /* 482 * There are only a couple of trap types that are expected. 483 * All the rest will be handled in the usual way. 484 */ |
484 switch (type) { 485 /* Privilieged instruction fault. */ 486 case T_PRIVINFLT: 487 break; | 485 switch (frame->tf_trapno) { |
488 /* General protection fault. */ 489 case T_PROTFLT: 490 /* Flag an illegal operation. */ 491 cpu_core[curcpu].cpuc_dtrace_flags |= CPU_DTRACE_ILLOP; 492 493 /* 494 * Offset the instruction pointer to the instruction 495 * following the one causing the fault. --- 24 unchanged lines hidden --- | 486 /* General protection fault. */ 487 case T_PROTFLT: 488 /* Flag an illegal operation. */ 489 cpu_core[curcpu].cpuc_dtrace_flags |= CPU_DTRACE_ILLOP; 490 491 /* 492 * Offset the instruction pointer to the instruction 493 * following the one causing the fault. --- 24 unchanged lines hidden --- |