⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 profile.c

📁 一个用在mips体系结构中的操作系统
💻 C
字号:
/* * Copyright (C) 1996-1998 by the Board of Trustees *    of Leland Stanford Junior University. *  * This file is part of the SimOS distribution.  * See LICENSE file for terms of the license.  * *//***************************************************************** * profile.c *  * Profiling support for simos. You must use a special "prof" to * view the results generated here. We currently only support * profiling on the SGI platform.  * * $Author: bosch $ * $Date: 1998/02/10 00:29:46 $ *****************************************************************/#include <sys/types.h> #include <sys/time.h>#include <fcntl.h>#include <stdlib.h>#include "simutil.h"#include "sim_error.h"#include "profile.h"#ifdef PROFILING#if defined(sgi)#include <cmplrs/prof_header.h>#include <sys/profil.h>extern int monitor(int, int, void *, void *);extern void moncontrol(int);extern _ftext[];extern etext[]; extern int errno;#endifvoidStartProfile(void){#ifdef sgi    int err = 0;    err = monitor(0, 1, _ftext, etext);    if (err < 0) {       CPUWarning("Error enabling profiling, errno = %d\n", errno);       return;    }    CPUWarning("SIMOS: Starting profile\n");#else    CPUWarning("SIMOS: Profiling only available on SGI's\n");#endif}void StopProfile(void){#ifdef sgi   moncontrol(3);   CPUWarning("SIMOS: Stopping profile\n");   return;#else    CPUWarning("SIMOS: Profiling only available on SGI's\n");#endif}#else/* PROFILING IS NOT DEFINED */void StartProfile(void){   CPUWarning("SIMOS: Must define PROFILING to use profiling\n");}void StopProfile(void){   CPUWarning("SIMOS: Must define PROFILING to use profiling\n");}#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -