db_insert.c File Reference

Inserting a key-value pair into a DB. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include "odb.h"
Include dependency graph for db_insert.c:

Defines

#define _GNU_SOURCE

Functions

int odb_update_node (odb_t *odb, odb_key_t key)
 update info at key by incrementing its associated value by one, if the key does not exist a new node is created and the value associated is set to one.
int odb_update_node_with_offset (odb_t *odb, odb_key_t key, unsigned long int offset)
 odb_update_node_with_offset
int odb_add_node (odb_t *odb, odb_key_t key, odb_value_t value)
 Add a new node w/o regarding if a node with the same key already exists.

Detailed Description

Inserting a key-value pair into a DB.

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

Define Documentation

#define _GNU_SOURCE

Function Documentation

int odb_add_node ( odb_t odb,
odb_key_t  key,
odb_value_t  value 
)

Add a new node w/o regarding if a node with the same key already exists.

returns EXIT_SUCCESS on success, EXIT_FAILURE on failure

References odb_t::data.

Referenced by import_from_abi(), and main().

int odb_update_node ( odb_t odb,
odb_key_t  key 
)

update info at key by incrementing its associated value by one, if the key does not exist a new node is created and the value associated is set to one.

returns EXIT_SUCCESS on success, EXIT_FAILURE on failure

References odb_update_node_with_offset().

Referenced by operf_sfile_log_arc().

int odb_update_node_with_offset ( odb_t odb,
odb_key_t  key,
unsigned long int  offset 
)

odb_update_node_with_offset

Parameters:
odb the data base object to setup
key the hash key
offset the offset to be added

update info at key by adding the specified offset to its associated value, if the key does not exist a new node is created and the value associated is set to offset.

returns EXIT_SUCCESS on success, EXIT_FAILURE on failure

References odb_t::data, odb_data::hash_base, odb_node_t::key, odb_node_t::next, odb_data::node_base, and odb_node_t::value.

Referenced by odb_update_node(), operf_sfile_log_sample_count(), and sfile_log_sample_count().


Generated on 29 Jul 2013 for oprofile by  doxygen 1.6.1