Skip to content

Commit 4bc4858

Browse files
Doc/dead links (#5322)
doc: remove some dead links in LINKS.md Closes: #5318 Also add a CI to check dead links. Signed-off-by: Jiawei Zhao <[email protected]>
1 parent c31a1ca commit 4bc4858

File tree

3 files changed

+94
-9
lines changed

3 files changed

+94
-9
lines changed

.github/scripts/check_links.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#! /usr/bin/env python3
2+
3+
import re
4+
import requests
5+
import os
6+
from pathlib import Path
7+
8+
headers = {
9+
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'
10+
}
11+
timeout = 10
12+
13+
links_file = Path('LINKS.md')
14+
content = links_file.read_text(encoding='utf-8')
15+
16+
link_pattern = re.compile(r'\[([^\]]+)\]\(([^)]+)\)')
17+
links = link_pattern.findall(content)
18+
19+
broken_links = []
20+
for text, url in links:
21+
try:
22+
print(f"Checking: {url}")
23+
response = requests.head(url, headers=headers, timeout=timeout, allow_redirects=True)
24+
25+
if response.status_code >= 400:
26+
response = requests.get(url, headers=headers, timeout=timeout, allow_redirects=True)
27+
28+
if response.status_code >= 400:
29+
broken_links.append((text, url, response.status_code))
30+
except Exception as e:
31+
broken_links.append((text, url, str(e)))
32+
33+
if broken_links:
34+
report = "# Broken Links Report\n\n"
35+
report += "The following links in LINKS.md are broken:\n\n"
36+
report += "| Link Text | URL | Error |\n"
37+
report += "|-----------|-----|-------|\n"
38+
39+
for text, url, error in broken_links:
40+
report += f"| {text} | {url} | {error} |\n"
41+
42+
with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
43+
delimiter = "_REPORT_DELIMITER_"
44+
f.write(f"broken_links=true\n")
45+
f.write(f"report<<{delimiter}\n{report}\n{delimiter}\n")
46+
else:
47+
with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
48+
f.write("broken_links=false\n")

.github/workflows/check_links.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Check Broken Links
2+
3+
on:
4+
schedule:
5+
# First day of month at 00:00 in every 2nd month
6+
- cron: '0 0 1 */2 *'
7+
workflow_dispatch:
8+
9+
jobs:
10+
check-links:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v4
17+
with:
18+
python-version: '3.10'
19+
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install requests
24+
25+
- name: Check links in LINKS.md
26+
id: link-check
27+
run: python .github/scripts/check_links.py
28+
29+
- name: Create issue for broken links
30+
if: steps.link-check.outputs.broken_links == 'true'
31+
uses: actions/github-script@v6
32+
with:
33+
github-token: ${{ secrets.GITHUB_TOKEN }}
34+
script: |
35+
const report = `${{ steps.link-check.outputs.report }}`;
36+
await github.rest.issues.create({
37+
owner: context.repo.owner,
38+
repo: context.repo.repo,
39+
title: 'Broken links detected in LINKS.md',
40+
body: report,
41+
labels: ['documentation']
42+
});

LINKS.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
- 2019-12-06: [My learnings on Linux BPF container performance engineering](https://medium.com/@aimvec/my-learnings-on-linux-bpf-container-performance-engineering-3eb424b73d56)
22
- 2019-11-21: [Debugging network stalls on Kubernetes](https://github.blog/2019-11-21-debugging-network-stalls-on-kubernetes)
33
- 2019-11-12: [bcc-tools brings dynamic kernel tracing to Red Hat Enterprise Linux 8.1](https://www.redhat.com/en/blog/bcc-tools-brings-dynamic-kernel-tracing-red-hat-enterprise-linux-81)
4-
- 2018-05-03: [Linux System Monitoring with eBPF](https://www.circonus.com/2018/05/linux-system-monitoring-with-ebpf)
4+
- 2018-05-03: [Linux System Monitoring with eBPF](https://www.heinrichhartmann.com/pdf/Heinrich%20Hartmann%20-%20Linux%20System%20Monitoring%20with%20eBPF.pdf)
55
- 2018-02-22: [Some advanced BCC topics](https://lwn.net/Articles/747640)
66
- 2018-01-23: [BPFd: Running BCC tools remotely across systems and architectures](https://lwn.net/Articles/744522)
77
- 2017-12-22: [An introduction to the BPF Compiler Collection](https://lwn.net/Articles/742082)
@@ -10,35 +10,30 @@
1010
- 2017-07-13: [Performance Superpowers with Enhanced BPF](https://www.usenix.org/conference/atc17/program/presentation/gregg-superpowers)
1111
- 2017-06-28: [The BSD Packet Filter](https://speakerdeck.com/tuxology/the-bsd-packet-filter)
1212
- 2017-03-04: [Linux 4.x Tracing: Performance Analysis with bcc/BPF](https://www.slideshare.net/brendangregg/linux-4x-tracing-performance-analysis-with-bccbpf)
13-
- 2017-02-27: [Profiling a .NET Core Application on Linux](https://blogs.microsoft.co.il/sasha/2017/02/27/profiling-a-net-core-application-on-linux)
1413
- 2017-02-05: [gobpf - utilizing eBPF from Go](https://fosdem.org/2017/schedule/event/go_bpf/attachments/slides/1681/export/events/attachments/go_bpf/slides/1681/gobpf_utilizing_eBPF_from_Go_FOSDEM_2017.pdf)
1514
- 2017-01-31: [Golang bcc/BPF Function Tracing](http://www.brendangregg.com/blog/2017-01-31/golang-bcc-bpf-function-tracing.html)
1615
- 2017-01-18: [BPF: Tracing and more](https://www.slideshare.net/brendangregg/bpf-tracing-and-more)
1716
- 2016-12-09: [Linux 4.x Tracing Tools: Using BPF Superpowers](https://www.slideshare.net/brendangregg/linux-4x-tracing-tools-using-bpf-superpowers)
18-
- 2016-11-30: [Introducing gobpf - Using eBPF from Go](https://kinvolk.io/blog/2016/11/introducing-gobpf---using-ebpf-from-go)
17+
- 2016-11-30: [Introducing gobpf - Using eBPF from Go](https://kinvolk.io/blog/2016/11/ebpf-gobpf)
1918
- 2016-11-30: [Linux bcc/BPF tcplife: TCP Lifespans](http://www.brendangregg.com/blog/2016-11-30/linux-bcc-tcplife.html)
2019
- 2016-10-27: [DTrace for Linux 2016](http://www.brendangregg.com/blog/2016-10-27/dtrace-for-linux-2016.html)
2120
- 2016-10-21: [Linux 4.9's Efficient BPF-based Profiler](http://www.brendangregg.com/blog/2016-10-21/linux-efficient-profiler.html)
2221
- 2016-10-15: [Linux bcc tcptop](http://www.brendangregg.com/blog/2016-10-15/linux-bcc-tcptop.html)
2322
- 2016-10-12: [Linux bcc/BPF Node.js USDT Tracing](http://www.brendangregg.com/blog/2016-10-12/linux-bcc-nodejs-usdt.html)
2423
- 2016-10-08: [Linux bcc/BPF Run Queue (Scheduler) Latency](http://www.brendangregg.com/blog/2016-10-08/linux-bcc-runqlat.html)
2524
- 2016-10-06: [Linux bcc ext4 Latency Tracing](http://www.brendangregg.com/blog/2016-10-06/linux-bcc-ext4dist-ext4slower.html)
26-
- 2016-10-04: [Installing bcc to evaluate BPF and Postgres](http://blog.gregburek.com/2016/10/04/installing-bcc-to-evaluate-bpf-and-postgres)
25+
- 2016-10-04: [Installing bcc to evaluate BPF and Postgres](https://www.gregburek.com/2016/10/04/installing-bcc-to-evaluate-bpf-and-postgres)
2726
- 2016-10-04: [Linux MySQL Slow Query Tracing with bcc/BPF](http://www.brendangregg.com/blog/2016-10-04/linux-bcc-mysqld-qslower.html)
2827
- 2016-10-01: [Linux bcc Tracing Security Capabilities](http://www.brendangregg.com/blog/2016-10-01/linux-bcc-security-capabilities.html)
2928
- 2016-09-23: [BCC – Dynamic Tracing Tools for Linux Performance Monitoring, Networking and More](http://www.tecmint.com/bcc-best-linux-performance-monitoring-tools/)
30-
- 2016-08-22: [BoF - What Can BPF Do For You?](https://events.linuxfoundation.org/sites/events/files/slides/iovisor-lc-bof-2016.pdf)
29+
- 2016-08-22: [BoF - What Can BPF Do For You?](https://events.static.linuxfound.org/sites/events/files/slides/iovisor-lc-bof-2016.pdf)
3130
- 2016-07-03: [Linux debugging tools I love](https://jvns.ca/blog/2016/07/03/debugging-tools-i-love)
3231
- 2016-06-14: [Ubuntu Xenial bcc/BPF](http://www.brendangregg.com/blog/2016-06-14/ubuntu-xenial-bcc-bpf.html)
3332
- 2016-05-26: [Linux BPF/bcc for Oracle Tracing](https://db-blog.web.cern.ch/blog/luca-canali/2016-05-linux-bpfbcc-oracle-tracing)
34-
- 2016-05-04: [Tracing your TCP IPv4 connections with eBPF and BCC from the Linux kernel JIT-VM to Splunk](https://www.splunk.com/blog/2016/05/04/tracing-your-tcp-ipv4-connections-with-ebpf-and-bcc-from-the-linux-kernel-jit-vm-to-splunk/)
35-
- 2016-03-31: [Probing the JVM with BPF/BCC](http://blogs.microsoft.co.il/sasha/2016/03/31/probing-the-jvm-with-bpfbcc/)
3633
- 2016-03-30: [How to turn any syscall into an event: Introducing eBPF Kernel probes](https://blog.yadutaf.fr/2016/03/30/turn-any-syscall-into-event-introducing-ebpf-kernel-probes)
37-
- 2016-03-30: [USDT Probe Support in BPF/BCC](http://blogs.microsoft.co.il/sasha/2016/03/30/usdt-probe-support-in-bpfbcc)
3834
- 2016-03-28: [Linux BPF/bcc Road Ahead, March 2016](http://www.brendangregg.com/blog/2016-03-28/linux-bpf-bcc-road-ahead-2016.html)
3935
- 2016-03-05: [Linux BPF Superpowers](http://www.brendangregg.com/blog/2016-03-05/linux-bpf-superpowers.html)
4036
- 2016-03-02: [Linux BPF Superpowers](https://www.slideshare.net/brendangregg/linux-bpf-superpowers)
41-
- 2016-02-14: [Two New eBPF Tools: memleak and argdist](http://blogs.microsoft.co.il/sasha/2016/02/14/two-new-ebpf-tools-memleak-and-argdist/)
4237
- 2016-02-08: [Linux eBPF/bcc uprobes](http://www.brendangregg.com/blog/2016-02-08/linux-ebpf-bcc-uprobes.html)
4338
- 2016-02-05: [Who is waking the waker? (Linux chain graph prototype)](http://www.brendangregg.com/blog/2016-02-05/ebpf-chaingraph-prototype.html)
4439
- 2016-02-01: [Linux Wakeup and Off-Wake Profiling](http://www.brendangregg.com/blog/2016-02-01/linux-wakeup-offwake-profiling.html)

0 commit comments

Comments
 (0)