Skip to content

Commit

Permalink
Motivate delete() before update() in tutorial (iovisor#651)
Browse files Browse the repository at this point in the history
  • Loading branch information
pchaigno authored and 4ast committed Aug 9, 2016
1 parent 0519650 commit 1e45e67
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/tutorial_bcc_python_developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ Things to learn:
1. ```BPF_HASH(last)```: Creates a BPF map object that is a hash (associative array), called "last". We didn't specify any further arguments, so it defaults to key and value types of u64.
1. ```key = 0```: We'll only store one key/value pair in this hash, where the key is hardwired to zero.
1. ```last.lookup(&key)```: Lookup the key in the hash, and return a pointer to its value if it exists, else NULL. We pass the key in as an address to a pointer.
1. ```last.delete(&key)```: Delete the key from the hash.
1. ```last.delete(&key)```: Delete the key from the hash. This is currently required because of [a kernel bug in `.update()`](https://git.kernel.org/cgit/linux/kernel/git/davem/net.git/commit/?id=a6ed3ea65d9868fdf9eff84e6fe4f666b8d14b02).
1. ```last.update(&key)```: Set the key to equal the value in the 2nd argument. This records the timestamp.

### Lesson 5. sync_count.py
Expand Down

0 comments on commit 1e45e67

Please sign in to comment.