1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-23 21:34:54 +03:00
libvirt/examples/systemtap/qemu-monitor.stp
Daniel P. Berrangé 600462834f Remove all Author(s): lines from source file headers
In many files there are header comments that contain an Author:
statement, supposedly reflecting who originally wrote the code.
In a large collaborative project like libvirt, any non-trivial
file will have been modified by a large number of different
contributors. IOW, the Author: comments are quickly out of date,
omitting people who have made significant contribitions.

In some places Author: lines have been added despite the person
merely being responsible for creating the file by moving existing
code out of another file. IOW, the Author: lines give an incorrect
record of authorship.

With this all in mind, the comments are useless as a means to identify
who to talk to about code in a particular file. Contributors will always
be better off using 'git log' and 'git blame' if they need to  find the
author of a particular bit of code.

This commit thus deletes all Author: comments from the source and adds
a rule to prevent them reappearing.

The Copyright headers are similarly misleading and inaccurate, however,
we cannot delete these as they have legal meaning, despite being largely
inaccurate. In addition only the copyright holder is permitted to change
their respective copyright statement.

Reviewed-by: Erik Skultety <eskultet@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-12-13 16:08:38 +00:00

80 lines
3.2 KiB
Plaintext

#!/usr/bin/stap
#
# Copyright (C) 2011 Red Hat, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library. If not, see
# <http://www.gnu.org/licenses/>.
#
#
# This script will monitor all messages sent/received between libvirt
# and the QEMU monitor
#
# stap qemu-monitor.stp
# 0.000 begin
# 3.848 ! 0x7f2dc00017b0 {"timestamp": {"seconds": 1319466931, "microseconds": 187755}, "event": "SHUTDOWN"}
# 5.773 > 0x7f2dc0007960 {"execute":"qmp_capabilities","id":"libvirt-1"}
# 5.774 < 0x7f2dc0007960 {"return": {}, "id": "libvirt-1"}
# 5.774 > 0x7f2dc0007960 {"execute":"query-commands","id":"libvirt-2"}
# 5.777 < 0x7f2dc0007960 {"return": [{"name": "quit"}, {"name": ....snip....
# 5.777 > 0x7f2dc0007960 {"execute":"query-chardev","id":"libvirt-3"}
# 5.778 < 0x7f2dc0007960 {"return": [{"filename": ....snip....
# 5.779 > 0x7f2dc0007960 {"execute":"query-cpus","id":"libvirt-4"}
# 5.780 < 0x7f2dc0007960 {"return": [{"current": true, "CPU": 0, "pc": 1048560, "halted": false, "thread_id": 13299}], "id": "libvirt-4"}
# 5.780 > 0x7f2dc0007960 {"execute":"set_password","arguments":{"protocol":"vnc","password":"123456","connected":"keep"},"id":"libvirt-5"}
# 5.782 < 0x7f2dc0007960 {"return": {}, "id": "libvirt-5"}
# 5.782 > 0x7f2dc0007960 {"execute":"expire_password","arguments":{"protocol":"vnc","time":"never"},"id":"libvirt-6"}
# 5.783 < 0x7f2dc0007960 {"return": {}, "id": "libvirt-6"}
# 5.783 > 0x7f2dc0007960 {"execute":"balloon","arguments":{"value":224395264},"id":"libvirt-7"}
# 5.785 < 0x7f2dc0007960 {"return": {}, "id": "libvirt-7"}
# 5.785 > 0x7f2dc0007960 {"execute":"cont","id":"libvirt-8"}
# 5.789 ! 0x7f2dc0007960 {"timestamp": {"seconds": 1319466933, "microseconds": 129980}, "event": "RESUME"}
# 5.789 < 0x7f2dc0007960 {"return": {}, "id": "libvirt-8"}
# 7.537 ! 0x7f2dc0007960 {"timestamp": {"seconds": 1319466934, "microseconds": 881214}, "event": "SHUTDOWN"}
#
global start
# Print a string, with a timestamp relative to the start of the script
function print_ts(msg)
{
now = gettimeofday_ns() / (1000*1000)
delta = (now - start)
printf("%3d.%03d %s\n", (delta / 1000), (delta % 1000), msg);
}
# Just so we know the script is now running
probe begin {
start = gettimeofday_ns() / (1000*1000)
print_ts("begin")
}
probe libvirt.qemu.monitor_send_msg {
if (fd != -1) {
print_ts(sprintf("> %p %s (fd=%d)", mon, substr(msg, 0, strlen(msg)-2), fd));
} else {
print_ts(sprintf("> %p %s", mon, substr(msg, 0, strlen(msg)-2)));
}
}
probe libvirt.qemu.monitor_recv_reply {
print_ts(sprintf("< %p %s", mon, reply));
}
probe libvirt.qemu.monitor_recv_event {
print_ts(sprintf("! %p %s", mon, event));
}