Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Alternative handling of tracemem's dynamic size.
The tracemem() action takes a constant size argument that gives the size of the buffer used. Optionally, it also takes another size argument that is dynamically computed. Currently, in this DTrace port, this dsize is used only by the consumer, to limit how much data is displayed. The documentation is unclear if dsize should also limit how much data is written into the buffer in the first place. Arguably, it should: *) Copying less data might mean faster run time, although the savings would be very small and would incur the cost of extra BPF instructions. *) Copying less data might protect against accessing memory illegally. Using dsize to cap how much data is written into the buffer is implemented in this patch. Since any changes in behavior would not be seen in our testing, no test changes are made. Signed-off-by: Eugene Loh <eugene.loh@oracle.com> Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com> Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
- Loading branch information