Techniques for sampling and capturing central processing unit (CPU)-bound packets in a network device are provided. In one set of embodiments, the network device can receive a command to enable packet sampling for a class of network traffic, where the command specifies one or more sampling parameters. The network device can identify at least one CPU queue in a plurality of CPU queues of the network device to which the class of network traffic is mapped. The network device can then configure a driver of an operating system (OS) of the network device to begin sampling packets from said at least one CPU queue in accordance with the one or more sampling parameters.