Lines Matching defs:dof
37 /* The type of the ELF sections where we will find the DOF programs
175 /* DOF programs can contain an arbitrary number of sections of 26
204 DOF entities. Again, we only cover the subset of DOF used to
207 See linux/dtrace/dof.h header for a complete list of data
230 /* The DOF program is little-endian. */
232 /* The DOF program is big-endian. */
236 /* A DOF header, which describes the contents of a DOF program: number
255 /* File size of entire DOF file. */
261 /* A DOF section, whose contents depend on its type. The several
275 /* DOF + offset points to the section data. */
281 /* A DOF provider, which is the provider of a probe. */
309 /* A set of DOF probes and is-enabled probes sharing a base address
311 each probe are maintained in arrays in several other DOF sections.
347 /* DOF supports two different encodings: MSB (big-endian) and LSB
348 (little-endian). The encoding is itself encoded in the DOF header.
352 #define DOF_UINT(dof, field) \
355 (((dof)->dofh_ident[DTRACE_DOF_ID_ENCODING] \
359 /* The following macro applies a given byte offset to a DOF (a pointer
363 #define DTRACE_DOF_PTR(dof, offset) (&((char *) (dof))[(offset)])
366 section in a DOF object. The section is referred to by its index
369 #define DTRACE_DOF_SECT(dof, idx) \
371 DTRACE_DOF_PTR ((dof), \
372 DOF_UINT ((dof), (dof)->dofh_secoff) \
373 + ((idx) * DOF_UINT ((dof), (dof)->dofh_secsize))))
378 DOF program containing the attributes for the probe. */
384 struct dtrace_dof_hdr *dof,
429 num_probes = DOF_UINT (dof, probe->dofpr_noffs);
434 DOF section. */
436 num_enablers = DOF_UINT (dof, probe->dofpr_nenoffs);
441 = ((uint32_t *) eofftab)[DOF_UINT (dof, probe->dofpr_enoffidx) + i];
443 enabler.address = DOF_UINT (dof, probe->dofpr_addr)
444 + DOF_UINT (dof, enabler_offset);
451 = ((uint32_t *) offtab)[DOF_UINT (dof, probe->dofpr_offidx) + i];
455 = strtab + DOF_UINT (dof, provider->dofpv_name);
456 const char *name = strtab + DOF_UINT (dof, probe->dofpr_name);
460 = DOF_UINT (dof, probe->dofpr_addr) + DOF_UINT (dof, probe_offset);
463 int probe_argc = DOF_UINT (dof, probe->dofpr_nargc);
469 p = strtab + DOF_UINT (dof, probe->dofpr_nargv);
514 /* Helper function to collect the probes described in the DOF program
515 whose header is pointed by DOF and add them to the PROBESP vector.
516 SECT is the ELF section containing the DOF program and OBJFILE is
522 struct dtrace_dof_hdr *dof)
528 /* The first step is to check for the DOF magic number. If no valid
529 DOF data is found in the section then a complaint is issued to
531 if (dof->dofh_ident[DTRACE_DOF_ID_MAG0] != 0x7F
532 || dof->dofh_ident[DTRACE_DOF_ID_MAG1] != 'D'
533 || dof->dofh_ident[DTRACE_DOF_ID_MAG2] != 'O'
534 || dof->dofh_ident[DTRACE_DOF_ID_MAG3] != 'F')
539 if (dof->dofh_ident[DTRACE_DOF_ID_ENCODING] != DTRACE_DOF_ENCODE_LSB
540 && dof->dofh_ident[DTRACE_DOF_ID_ENCODING] != DTRACE_DOF_ENCODE_MSB)
543 /* Make sure this DOF is not an enabling DOF, i.e. there are no ECB
545 section = (struct dtrace_dof_sect *) DTRACE_DOF_PTR (dof,
546 DOF_UINT (dof, dof->dofh_secoff));
547 for (i = 0; i < DOF_UINT (dof, dof->dofh_secnum); i++, section++)
553 the DOF then we just return. */
554 section = (struct dtrace_dof_sect *) DTRACE_DOF_PTR (dof,
555 DOF_UINT (dof, dof->dofh_secoff));
556 for (i = 0; i < DOF_UINT (dof, dof->dofh_secnum); i++, section++)
557 if (DOF_UINT (dof, section->dofs_type) == DTRACE_DOF_SECT_TYPE_PROVIDER)
560 DTRACE_DOF_PTR (dof, DOF_UINT (dof, section->dofs_offset));
562 = DTRACE_DOF_SECT (dof, DOF_UINT (dof, provider->dofpv_strtab));
564 = DTRACE_DOF_SECT (dof, DOF_UINT (dof, provider->dofpv_probes));
566 = DTRACE_DOF_SECT (dof, DOF_UINT (dof, provider->dofpv_prargs));
568 = DTRACE_DOF_SECT (dof, DOF_UINT (dof, provider->dofpv_proffs));
570 = DTRACE_DOF_SECT (dof, DOF_UINT (dof, provider->dofpv_prenoffs));
571 char *strtab = DTRACE_DOF_PTR (dof, DOF_UINT (dof, strtab_s->dofs_offset));
572 char *offtab = DTRACE_DOF_PTR (dof, DOF_UINT (dof, offsets_s->dofs_offset));
573 char *eofftab = DTRACE_DOF_PTR (dof, DOF_UINT (dof, eoffsets_s->dofs_offset));
574 char *argtab = DTRACE_DOF_PTR (dof, DOF_UINT (dof, args_s->dofs_offset));
575 unsigned int entsize = DOF_UINT (dof, probes_s->dofs_entsize);
578 if (DOF_UINT (dof, section->dofs_size)
591 num_probes = DOF_UINT (dof, probes_s->dofs_size) / entsize;
596 DTRACE_DOF_PTR (dof, DOF_UINT (dof, probes_s->dofs_offset)
597 + (i * DOF_UINT (dof, probes_s->dofs_entsize)));
601 dof, probe,
603 DOF_UINT (dof, strtab_s->dofs_size));
610 complaint (_("skipping section '%s' which does not contain valid DOF data."),
846 bfd_byte *dof;
848 /* Read the contents of the DOF section and then process it to
850 if (bfd_malloc_and_get_section (abfd, sect, &dof) && dof != NULL)
852 (struct dtrace_dof_hdr *) dof);
858 xfree (dof);