*/
void StatsAddUI64(ThreadVars *tv, uint16_t id, uint64_t x)
{
- SCPerfPrivateContext *pca = &tv->perf_private_ctx;
+ StatsPrivateThreadContext *pca = &tv->perf_private_ctx;
#ifdef UNITTESTS
if (pca->initialized == 0)
return;
*/
void StatsIncr(ThreadVars *tv, uint16_t id)
{
- SCPerfPrivateContext *pca = &tv->perf_private_ctx;
+ StatsPrivateThreadContext *pca = &tv->perf_private_ctx;
#ifdef UNITTESTS
if (pca->initialized == 0)
return;
* \brief Sets a value of type double to the local counter
*
* \param id Index of the local counter in the counter array
- * \param pca Pointer to the SCPerfPrivateContext
+ * \param pca Pointer to the StatsPrivateThreadContext
* \param x The value to set for the counter
*/
void StatsSetUI64(ThreadVars *tv, uint16_t id, uint64_t x)
{
- SCPerfPrivateContext *pca = &tv->perf_private_ctx;
+ StatsPrivateThreadContext *pca = &tv->perf_private_ctx;
#ifdef UNITTESTS
if (pca->initialized == 0)
return;
/**
* \brief Copies the SCPerfCounter value from the local counter present in the
- * SCPerfPrivateContext to its corresponding global counterpart. Used
+ * StatsPrivateThreadContext to its corresponding global counterpart. Used
* internally by SCPerfUpdateCounterArray()
*
- * \param pcae Pointer to the SCPerfPrivateContext which holds the local
+ * \param pcae Pointer to the StatsPrivateThreadContext which holds the local
* versions of the counters
*/
static void SCPerfCopyCounterValue(SCPCAElem *pcae)
*/
static int SCPerfGetCounterArrayRange(uint16_t s_id, uint16_t e_id,
StatsPublicThreadContext *pctx,
- SCPerfPrivateContext *pca)
+ StatsPrivateThreadContext *pca)
{
SCPerfCounter *pc = NULL;
uint32_t i = 0;
* \retval pca Pointer to a counter-array for all counter of this tm instance
* on success; NULL on failure
*/
-static int SCPerfGetAllCountersArray(StatsPublicThreadContext *pctx, SCPerfPrivateContext *private)
+static int SCPerfGetAllCountersArray(StatsPublicThreadContext *pctx, StatsPrivateThreadContext *private)
{
if (pctx == NULL || private == NULL)
return -1;
/**
* \brief Syncs the counter array with the global counter variables
*
- * \param pca Pointer to the SCPerfPrivateContext
+ * \param pca Pointer to the StatsPrivateThreadContext
* \param pctx Pointer the the tv's StatsPublicThreadContext
*
* \retval 0 on success
* \retval -1 on error
*/
-int SCPerfUpdateCounterArray(SCPerfPrivateContext *pca, StatsPublicThreadContext *pctx)
+int SCPerfUpdateCounterArray(StatsPrivateThreadContext *pca, StatsPublicThreadContext *pctx)
{
SCPCAElem *pcae = NULL;
uint32_t i = 0;
*/
uint64_t SCPerfGetLocalCounterValue(ThreadVars *tv, uint16_t id)
{
- SCPerfPrivateContext *pca = &tv->perf_private_ctx;
+ StatsPrivateThreadContext *pca = &tv->perf_private_ctx;
#ifdef DEBUG
BUG_ON ((id < 1) || (id > pca->size));
#endif
}
/**
- * \brief Releases the SCPerfPrivateContext allocated by the user, for storing and
+ * \brief Releases the StatsPrivateThreadContext allocated by the user, for storing and
* updating local counter values
*
- * \param pca Pointer to the SCPerfPrivateContext
+ * \param pca Pointer to the StatsPrivateThreadContext
*/
-void SCPerfReleasePCA(SCPerfPrivateContext *pca)
+void SCPerfReleasePCA(StatsPrivateThreadContext *pca)
{
if (pca != NULL) {
if (pca->head != NULL) {
static int SCPerfTestCntArraySize07()
{
ThreadVars tv;
- SCPerfPrivateContext *pca = NULL;
+ StatsPrivateThreadContext *pca = NULL;
int result;
memset(&tv, 0, sizeof(ThreadVars));
- //pca = (SCPerfPrivateContext *)&tv.perf_private_ctx;
+ //pca = (StatsPrivateThreadContext *)&tv.perf_private_ctx;
RegisterCounter("t1", "c1", &tv.perf_public_ctx);
RegisterCounter("t2", "c2", &tv.perf_public_ctx);
static int SCPerfTestUpdateCounter08()
{
ThreadVars tv;
- SCPerfPrivateContext *pca = NULL;
+ StatsPrivateThreadContext *pca = NULL;
int id;
int result;
static int SCPerfTestUpdateCounter09()
{
ThreadVars tv;
- SCPerfPrivateContext *pca = NULL;
+ StatsPrivateThreadContext *pca = NULL;
uint16_t id1, id2;
int result;
static int SCPerfTestUpdateGlobalCounter10()
{
ThreadVars tv;
- SCPerfPrivateContext *pca = NULL;
+ StatsPrivateThreadContext *pca = NULL;
int result = 1;
uint16_t id1, id2, id3;
static int SCPerfTestCounterValues11()
{
ThreadVars tv;
- SCPerfPrivateContext *pca = NULL;
+ StatsPrivateThreadContext *pca = NULL;
int result = 1;
uint16_t id1, id2, id3, id4;
} StatsPublicThreadContext;
/**
- * \brief Node elements used by the SCPerfPrivateContext(PCA) Node
+ * \brief Node elements used by the StatsPrivateThreadContext(PCA) Node
*/
typedef struct SCPCAElem_ {
/* pointer to the PerfCounter that corresponds to this PCAElem */
/**
* \brief used to hold the private version of the counters registered
*/
-typedef struct SCPerfPrivateContext_ {
+typedef struct StatsPrivateThreadContext_ {
/* points to the array holding PCAElems */
SCPCAElem *head;
uint32_t size;
int initialized;
-} SCPerfPrivateContext;
+} StatsPrivateThreadContext;
/* the initialization functions */
void StatsInit(void);
uint16_t StatsRegisterGlobalCounter(char *cname, uint64_t (*Func)(void));
/* utility functions */
-int SCPerfUpdateCounterArray(SCPerfPrivateContext *, StatsPublicThreadContext *);
+int SCPerfUpdateCounterArray(StatsPrivateThreadContext *, StatsPublicThreadContext *);
uint64_t SCPerfGetLocalCounterValue(struct ThreadVars_ *, uint16_t);
int SCPerfSetupPrivate(struct ThreadVars_ *);
/* functions used to free the resources alloted by the Perf counter API */
void SCPerfReleaseResources(void);
-void SCPerfReleasePCA(SCPerfPrivateContext *);
+void SCPerfReleasePCA(StatsPrivateThreadContext *);
/* functions used to update local counter values */
void StatsAddUI64(struct ThreadVars_ *, uint16_t, uint64_t);