Skip to content

Commit

Permalink
rocm: refactor get_context_counters
Browse files Browse the repository at this point in the history
The function already takes rocp_ctx as input argument thus there is no
need to pass events_id as input argument as well.
  • Loading branch information
gcongiu committed Nov 7, 2023
1 parent f91bb55 commit 6a96162
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/rocm/roc_profiler.c
Original file line number Diff line number Diff line change
Expand Up @@ -1169,7 +1169,7 @@ static int fetch_dispatch_counter(unsigned long);
static cb_context_node_t *alloc_context_node(int);
static void free_context_node(cb_context_node_t *);
static int get_context_node(int, cb_context_node_t **);
static int get_context_counters(unsigned int *, unsigned int, cb_context_node_t *, rocp_ctx_t);
static int get_context_counters(unsigned int, cb_context_node_t *, rocp_ctx_t);
static void put_context_counters(rocprofiler_feature_t *, int, cb_context_node_t *);
static void put_context_node(unsigned int, cb_context_node_t *);
static int intercept_ctx_init(unsigned int *, int, rocp_ctx_t *);
Expand Down Expand Up @@ -1314,7 +1314,6 @@ int
intercept_ctx_read(rocp_ctx_t rocp_ctx, long long **counts)
{
int papi_errno = PAPI_OK;
unsigned int *events_id = rocp_ctx->u.intercept.events_id;

_papi_hwi_lock(_rocm_lock);

Expand Down Expand Up @@ -1348,7 +1347,7 @@ intercept_ctx_read(rocp_ctx_t rocp_ctx, long long **counts)
break;
}

get_context_counters(events_id, dev_id, n, rocp_ctx);
get_context_counters(dev_id, n, rocp_ctx);
dispatch_count = decrement_and_fetch_dispatch_counter(tid);
free_context_node(n);
}
Expand Down Expand Up @@ -1955,9 +1954,10 @@ decrement_and_fetch_dispatch_counter(unsigned long tid)
}

int
get_context_counters(unsigned int *events_id, unsigned int dev_id, cb_context_node_t *n, rocp_ctx_t rocp_ctx)
get_context_counters(unsigned int dev_id, cb_context_node_t *n, rocp_ctx_t rocp_ctx)
{
int papi_errno = PAPI_OK;
unsigned int *events_id = rocp_ctx->u.intercept.events_id;

/* Here we get events_id ordered according to user's viewpoint and we want
* to map these to events_id ordered according to callbacks' viewpoint. We
Expand Down

0 comments on commit 6a96162

Please sign in to comment.