klog.c revision de3d2ce46fc25c7b67ccbae4afe5f15e5357568f
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 2008-2009, Intel Corporation.
* All Rights Reserved.
*/
#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
#include <string.h>
#include <procfs.h>
#include <fcntl.h>
#include <limits.h>
#include <unistd.h>
#include "latencytop.h"
static int klog_level = LT_KLOG_LEVEL_NONE;
static void
{
char tmp[16];
}
static void
{
key);
}
/*
* Initialize kernel stack logging.
*/
void
lt_klog_init(void)
{
return;
}
}
/*
* Set log file path.
*/
int
lt_klog_set_log_file(const char *filename)
{
int file_exist;
return (-1);
}
/* Test if we can write to the file */
return (-2);
}
/* Don't leave empty file behind */
if (!file_exist) {
}
sizeof (klog_filename));
return (0);
}
/*
* Set log level.
*/
int
{
return (-1);
}
klog_level = level;
return (0);
}
/*
* Write the log to file.
*/
void
lt_klog_write(void)
{
char buffer[32];
if (klog_level == LT_KLOG_LEVEL_NONE) {
return;
}
return;
}
}
/*
* Clean up function. This will cause all log in memory be written to the
* log file.
*/
void
lt_klog_deinit(void)
{
if (klog_table != NULL) {
klog_table = NULL;
}
if (proc_table != NULL) {
proc_table = NULL;
}
}
/*
* Log a stack and its statistics. Only "total" will be logged, others are
* internally discarded.
*/
/* ARGSUSED */
void
{
char *psargs;
char *str;
int str_len;
if ((level & klog_level) == 0) {
return;
}
}
return;
}
}
} else {
}
}