db_test.c File Reference

#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include "op_sample_file.h"
#include "odb.h"
Include dependency graph for db_test.c:

Go to the source code of this file.

Defines

#define TEST_FILENAME   "test-hash-db.dat"
#define verbprintf(args...)

Functions

static double used_time (void)
static void speed_test (int nr_item, char const *test_name)
static void do_speed_test (void)
static int test (int nr_item, int nr_unique_item)
static void do_test (void)
static void sanity_check (char const *filename)
int main (int argc, char *argv[1])

Variables

static int nr_error
static int verbose = 0

Detailed Description

Tests for DB hash

Remarks:
Copyright 2002 OProfile authors
Read the file COPYING
Author:
Philippe Elie

Definition in file db_test.c.


Define Documentation

#define TEST_FILENAME   "test-hash-db.dat"

Definition at line 22 of file db_test.c.

Referenced by do_speed_test(), main(), speed_test(), and test().

#define verbprintf ( args...   ) 
Value:
do { \
        if (verbose) \
            printf(args); \
    } while (0)

Definition at line 28 of file db_test.c.


Function Documentation

static void do_speed_test ( void   )  [static]

Definition at line 75 of file db_test.c.

References speed_test(), and TEST_FILENAME.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static void do_test ( void   )  [static]

Definition at line 121 of file db_test.c.

References nr_error, test(), and verbprintf.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

int main ( int  argc,
char *  argv[1] 
)

Definition at line 163 of file db_test.c.

References do_speed_test(), do_test(), nr_error, sanity_check(), speed_test(), and TEST_FILENAME.

Here is the call graph for this function:

static void sanity_check ( char const *  filename  )  [static]

Definition at line 139 of file db_test.c.

References nr_error, odb_check_hash(), odb_close(), odb_hash_display_stat(), odb_hash_free_stat(), odb_hash_stat(), odb_open(), and ODB_RDONLY.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static void speed_test ( int  nr_item,
char const *  test_name 
) [static]

Definition at line 46 of file db_test.c.

References odb_close(), odb_open(), ODB_RDWR, odb_update_node(), TEST_FILENAME, used_time(), and verbprintf.

Referenced by do_speed_test(), and main().

Here is the call graph for this function:

Here is the caller graph for this function:

static int test ( int  nr_item,
int  nr_unique_item 
) [static]

Definition at line 88 of file db_test.c.

References odb_check_hash(), odb_close(), odb_open(), ODB_RDWR, odb_update_node(), and TEST_FILENAME.

Referenced by do_test(), and main().

Here is the call graph for this function:

Here is the caller graph for this function:

static double used_time ( void   )  [static]

Definition at line 34 of file db_test.c.

Referenced by speed_test().

Here is the caller graph for this function:


Variable Documentation

int nr_error [static]

Definition at line 24 of file db_test.c.

Referenced by do_test(), main(), and sanity_check().

int verbose = 0 [static]

Definition at line 26 of file db_test.c.


Generated on 8 Nov 2012 for Oprofile by  doxygen 1.6.1