* Set up a space in the DSM for all workers to record instrumentation data * about their hash table. */
| 3303 | * about their hash table. |
| 3304 | */ |
| 3305 | void |
| 3306 | ExecHashInitializeDSM(HashState *node, ParallelContext *pcxt) |
| 3307 | { |
| 3308 | size_t size; |
| 3309 | |
| 3310 | /* don't need this if not instrumenting or no workers */ |
| 3311 | if (!node->ps.instrument || pcxt->nworkers == 0) |
| 3312 | return; |
| 3313 | |
| 3314 | size = offsetof(SharedHashInfo, hinstrument) + |
| 3315 | pcxt->nworkers * sizeof(HashInstrumentation); |
| 3316 | node->shared_info = (SharedHashInfo *) shm_toc_allocate(pcxt->toc, size); |
| 3317 | |
| 3318 | /* Each per-worker area must start out as zeroes. */ |
| 3319 | memset(node->shared_info, 0, size); |
| 3320 | |
| 3321 | node->shared_info->num_workers = pcxt->nworkers; |
| 3322 | shm_toc_insert(pcxt->toc, node->ps.plan->plan_node_id, |
| 3323 | node->shared_info); |
| 3324 | } |
| 3325 | |
| 3326 | /* |
| 3327 | * Locate the DSM space for hash table instrumentation data that we'll write |
no test coverage detected