# How to track fileds of metadata with p4dbg?

**URL:** <https://forum.p4.org/t/how-to-track-fileds-of-metadata-with-p4dbg/1100>\
**Category:** Getting Started with P4\
**Created:** [February 26, 2024, 2:40pm UTC](https://forum.p4.org/t/how-to-track-fileds-of-metadata-with-p4dbg/1100 "2024-02-26T14:40:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Klay](https://avatars.discourse-cdn.com/v4/letter/k/49beb7/32.png) [@Klay](https://forum.p4.org/u/Klay)\
**Post date:** [February 26, 2024, 2:40pm UTC](https://forum.p4.org/t/how-to-track-fileds-of-metadata-with-p4dbg/1100/1 "2024-02-26T14:40:26Z")

</div>

I’m confused that it didn’t work when I tried to set a watch point on a filed of metadata. My input and output are as follows. `udp_Rp` is one of fileds in metadata.

```bash
P4DBG: w udp_Rp 
Error: Unknow field name 'udp_Rp'

```

How do I fix it?

---

<div class="post-metadata">

**Author:** ![Faris](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.p4.org/faris/32/134_2.png) [@Faris](https://forum.p4.org/u/Faris)\
**Post date:** [February 29, 2024, 9:59am UTC](https://forum.p4.org/t/how-to-track-fileds-of-metadata-with-p4dbg/1100/2 "2024-02-29T09:59:02Z")

</div>

if it’s a field of metadata, I think you should use the syntax:

```auto
w meta.udp_Rp 

```

---

<div class="post-metadata">

**Author:** ![Klay](https://avatars.discourse-cdn.com/v4/letter/k/49beb7/32.png) [@Klay](https://forum.p4.org/u/Klay)\
**Post date:** [March 1, 2024, 5:54am UTC](https://forum.p4.org/t/how-to-track-fileds-of-metadata-with-p4dbg/1100/3 "2024-03-01T05:54:51Z")

</div>

Thank you. But I tried this and it still showed the same error as before.

---

<div class="post-metadata">

**Author:** ![andyfingerhut](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.p4.org/andyfingerhut/32/17_2.png) [@andyfingerhut](https://forum.p4.org/u/andyfingerhut)\
**Post date:** [March 1, 2024, 6:16am UTC](https://forum.p4.org/t/how-to-track-fileds-of-metadata-with-p4dbg/1100/4 "2024-03-01T06:16:26Z")

</div>

This answer may not be of interest to you, and if so, my apologies, and hopefully someone else can help you in your use of p4dbg. I personally have not used p4dbg, so have no knowledge about it with which to answer your direct question.

I would recommend that you consider the option of using the bmv2 switch logs for debugging your P4 program. It is not an interactive debugger, I know, but it can give you a wealth of information about the behavior of your P4 programs. In particular, you should be able to search through those logs for the string “udp\_Rp” to find all occurrences of assignments to it, and see when they happened relative to other statements in your P4 program.

---

<div class="post-metadata">

**Author:** ![Klay](https://avatars.discourse-cdn.com/v4/letter/k/49beb7/32.png) [@Klay](https://forum.p4.org/u/Klay)\
**Post date:** [March 2, 2024, 3:50am UTC](https://forum.p4.org/t/how-to-track-fileds-of-metadata-with-p4dbg/1100/5 "2024-03-02T03:50:33Z")

</div>

The bmv2 switch log is helpful, like you said. I’ve already develop my programs with those logs since I used p4 language. I’m exploring a new way that can actually make the development more effective, and that’s why I raised this question. Anyway, thanks for your answer. It means a lot.
