Callers of ctf_str_add_no_dedup_ref are indicating that they would like the
string they have added a reference to to appear in the current dict and not
be deduplicated into the parent. This is true even if the string already
exists in the parent, so we should not check for strings in the parent and
reuse them in this case.
int added = 0;
ctf_dict_t *lookup_fp = fp;
- /* Check for existing atoms in the parent as well. */
+ /* Check for existing atoms in the parent as well, unless they are marked
+ non-deduplicable. */
atom = ctf_dynhash_lookup (fp->ctf_str_atoms, str);
- if (!atom && fp->ctf_parent)
+ if (!atom && fp->ctf_parent && !(flags & CTF_STR_NO_DEDUP))
{
lookup_fp = fp->ctf_parent;
atom = ctf_dynhash_lookup (lookup_fp->ctf_str_atoms, str);