Compare commits
4 commits
e042996b55
...
f2aaffc04a
| Author | SHA1 | Date | |
|---|---|---|---|
| f2aaffc04a | |||
| 41e3e29dc2 | |||
| 81b9ae8a98 | |||
| 03fa177095 |
6 changed files with 3521 additions and 19 deletions
10
README.md
10
README.md
|
|
@ -6,13 +6,13 @@ Powered by Svelte & SvelteKit
|
||||||
|
|
||||||
## Developing
|
## Developing
|
||||||
|
|
||||||
Once you've created a project and installed dependencies with `yarn install`, start a development server:
|
Once you've created a project and installed dependencies with `pnpm install`, start a development server:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
yarn dev
|
pnpm dev
|
||||||
|
|
||||||
# or start the server and open the app in a new browser tab
|
# or start the server and open the app in a new browser tab
|
||||||
yarn dev -- --open
|
pnpm dev -- --open
|
||||||
```
|
```
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
|
|
@ -20,7 +20,7 @@ yarn dev -- --open
|
||||||
To create a production version of your app:
|
To create a production version of your app:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
yarn build
|
pnpm build
|
||||||
```
|
```
|
||||||
|
|
||||||
You can preview the production build with `npm run preview`.
|
You can preview the production build with `pnpm run preview`.
|
||||||
|
|
|
||||||
3306
pnpm-lock.yaml
generated
Normal file
3306
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load diff
159
src/routes/blog/detecting-smi/+page.md
Normal file
159
src/routes/blog/detecting-smi/+page.md
Normal file
|
|
@ -0,0 +1,159 @@
|
||||||
|
---
|
||||||
|
created: '2024-01-15'
|
||||||
|
title: 'Detecting System Management Interrupts (SMIs)'
|
||||||
|
description: ''
|
||||||
|
keywords:
|
||||||
|
- SMI
|
||||||
|
---
|
||||||
|
|
||||||
|
# System Management Interrutps (SMI)
|
||||||
|
|
||||||
|
- high priority interrupts caused by the hardware
|
||||||
|
- transparent to the operating system
|
||||||
|
- can be used by the mainboard for power management, thermal management, or other system-level functions independent of the OS
|
||||||
|
- can take a long time to execute, causing a CPU core to be blocked from other work
|
||||||
|
|
||||||
|
## Detecting SMIs
|
||||||
|
|
||||||
|
- compile a kernel with hwlat tracing capabilities; usually, a typical Linux kernel has this enabled; if not, the config can be found in the appendix
|
||||||
|
- after starting the machine with a trace-capable image
|
||||||
|
- check available tracers `cat /sys/kernel/debug/tracing/available_tracers`
|
||||||
|
- enable the tracer `echo hwlat > /sys/kernel/debug/tracing/current_tracer`
|
||||||
|
- there now should be a process "hwlat" running that takes up 50% of one CPU
|
||||||
|
- output of the hwlat tracer available `cat /sys/kernel/debug/tracing/trace` or `cat /sys/kernel/debug/tracing/trace_pipep`
|
||||||
|
|
||||||
|
## Example Output
|
||||||
|
|
||||||
|
```
|
||||||
|
# tracer: hwlat
|
||||||
|
#
|
||||||
|
# entries-in-buffer/entries-written: 1/1 #P:32
|
||||||
|
#
|
||||||
|
# _-----=> irqs-off
|
||||||
|
# / _----=> need-resched
|
||||||
|
# | / _---=> hardirq/softirq
|
||||||
|
# || / _--=> preempt-depth
|
||||||
|
# ||| / delay
|
||||||
|
# TASK-PID CPU# |||| TIMESTAMP FUNCTION
|
||||||
|
# | | | |||| | |
|
||||||
|
<...>-30395 [010] d... 533.362276: #1 inner/outer(us): 0/388 ts:1711469939.505579595 count:1
|
||||||
|
```
|
||||||
|
|
||||||
|
- inner/outer: where the latency was detected, see next section
|
||||||
|
|
||||||
|
### How does it work?
|
||||||
|
|
||||||
|
- this hwlat process is taking timestamps in a loop
|
||||||
|
- if distance between two timestamps is unreasonably large (bigger than ns), there was an SMI
|
||||||
|
- we should lower the threshold of this distance to 1us by executing `echo 1 > /sys/kernel/debug/tracing/tracing_thresh`
|
||||||
|
- the hwlat process is migrated over all the cores to catch SMIs there
|
||||||
|
- inner vs outer latency
|
||||||
|
|
||||||
|
```
|
||||||
|
while (run) {
|
||||||
|
start_ts = trace_local_clock();
|
||||||
|
end_ts = trace_local_clock();
|
||||||
|
if (!first && start_ts - last_ts > thresh)
|
||||||
|
record_outer();
|
||||||
|
if (end_ts - start_ts > thresh)
|
||||||
|
record_inner();
|
||||||
|
last_ts = end_ts;
|
||||||
|
first = 0;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Further options
|
||||||
|
|
||||||
|
- by default, only 50% CPU time is used
|
||||||
|
- this can be increased by echoing into `echo 9999999 > /sys/kernel/debug/tracing/hwlat_detector/width`, where the value is smaller than the set window `cat /sys/kernel/debug/tracing/hwlat_detector/window` to avoid starving the system.
|
||||||
|
- from my experience, this, however, is not necessary to catch SMIs. The default option is "good enough".
|
||||||
|
|
||||||
|
## Firing an SMI manually
|
||||||
|
|
||||||
|
- There is a nice small kernel module [here](https://github.com/jib218/kernel-module-smi-trigger) for manually triggering an SMI to verify the setup
|
||||||
|
- follow the instructions in the readme to compile and load the module
|
||||||
|
|
||||||
|
## Hardware Registers for counting SMIs
|
||||||
|
|
||||||
|
- Intel: MSR0x34, can be read out with turbostat / perf
|
||||||
|
- AMD: ls\_msi\_rx, can be used with `perf stat -e ls_smi_rx -I 60000`
|
||||||
|
However, doesn't seem to count everything; counts seem incorrect
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Sources, Appendix
|
||||||
|
|
||||||
|
- https://wiki.linuxfoundation.org/realtime/documentation/howto/tools/hwlat
|
||||||
|
- https://www.kernel.org/doc/html/latest/trace/hwlat_detector.html
|
||||||
|
- https://lwn.net/Articles/860578/
|
||||||
|
- https://www.jabperf.com/ima-let-you-finish-but-hunting-down-system-interrupts/
|
||||||
|
|
||||||
|
Custom Kernel Fragment: files/kernel\_config\_fragments/trace
|
||||||
|
|
||||||
|
```
|
||||||
|
CONFIG_USER_STACKTRACE_SUPPORT=y
|
||||||
|
CONFIG_NOP_TRACER=y
|
||||||
|
CONFIG_HAVE_RETHOOK=y
|
||||||
|
CONFIG_RETHOOK=y
|
||||||
|
CONFIG_HAVE_FUNCTION_TRACER=y
|
||||||
|
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
|
||||||
|
CONFIG_HAVE_FUNCTION_GRAPH_RETVAL=y
|
||||||
|
CONFIG_HAVE_DYNAMIC_FTRACE=y
|
||||||
|
CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y
|
||||||
|
CONFIG_HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS=y
|
||||||
|
CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS=y
|
||||||
|
CONFIG_HAVE_DYNAMIC_FTRACE_NO_PATCHABLE=y
|
||||||
|
CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
|
||||||
|
CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
|
||||||
|
CONFIG_HAVE_FENTRY=y
|
||||||
|
CONFIG_HAVE_OBJTOOL_MCOUNT=y
|
||||||
|
CONFIG_HAVE_OBJTOOL_NOP_MCOUNT=y
|
||||||
|
CONFIG_HAVE_C_RECORDMCOUNT=y
|
||||||
|
CONFIG_HAVE_BUILDTIME_MCOUNT_SORT=y
|
||||||
|
CONFIG_BUILDTIME_MCOUNT_SORT=y
|
||||||
|
CONFIG_TRACER_MAX_TRACE=y
|
||||||
|
CONFIG_TRACE_CLOCK=y
|
||||||
|
CONFIG_RING_BUFFER=y
|
||||||
|
CONFIG_EVENT_TRACING=y
|
||||||
|
CONFIG_CONTEXT_SWITCH_TRACER=y
|
||||||
|
CONFIG_RING_BUFFER_ALLOW_SWAP=y
|
||||||
|
CONFIG_PREEMPTIRQ_TRACEPOINTS=y
|
||||||
|
CONFIG_TRACING=y
|
||||||
|
CONFIG_GENERIC_TRACER=y
|
||||||
|
CONFIG_TRACING_SUPPORT=y
|
||||||
|
CONFIG_FTRACE=y
|
||||||
|
CONFIG_FUNCTION_TRACER=y
|
||||||
|
CONFIG_FUNCTION_GRAPH_TRACER=y
|
||||||
|
CONFIG_FUNCTION_GRAPH_RETVAL=y
|
||||||
|
CONFIG_DYNAMIC_FTRACE=y
|
||||||
|
CONFIG_DYNAMIC_FTRACE_WITH_REGS=y
|
||||||
|
CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS=y
|
||||||
|
CONFIG_DYNAMIC_FTRACE_WITH_ARGS=y
|
||||||
|
CONFIG_FPROBE=y
|
||||||
|
CONFIG_FUNCTION_PROFILER=y
|
||||||
|
CONFIG_TRACE_PREEMPT_TOGGLE=y
|
||||||
|
CONFIG_IRQSOFF_TRACER=y
|
||||||
|
CONFIG_PREEMPT_TRACER=y
|
||||||
|
CONFIG_SCHED_TRACER=y
|
||||||
|
CONFIG_HWLAT_TRACER=y
|
||||||
|
CONFIG_OSNOISE_TRACER=y
|
||||||
|
CONFIG_TIMERLAT_TRACER=y
|
||||||
|
CONFIG_MMIOTRACE=y
|
||||||
|
CONFIG_FTRACE_SYSCALLS=y
|
||||||
|
CONFIG_TRACER_SNAPSHOT=y
|
||||||
|
CONFIG_TRACER_SNAPSHOT_PER_CPU_SWAP=y
|
||||||
|
CONFIG_BRANCH_PROFILE_NONE=y
|
||||||
|
CONFIG_BLK_DEV_IO_TRACE=y
|
||||||
|
CONFIG_FPROBE_EVENTS=y
|
||||||
|
CONFIG_KPROBE_EVENTS=y
|
||||||
|
CONFIG_UPROBE_EVENTS=y
|
||||||
|
CONFIG_DYNAMIC_EVENTS=y
|
||||||
|
CONFIG_PROBE_EVENTS=y
|
||||||
|
CONFIG_FTRACE_MCOUNT_RECORD=y
|
||||||
|
CONFIG_FTRACE_MCOUNT_USE_CC=y
|
||||||
|
CONFIG_PROVIDE_OHCI1394_DMA_INIT=y
|
||||||
|
CONFIG_HAVE_SAMPLE_FTRACE_DIRECT=y
|
||||||
|
CONFIG_HAVE_SAMPLE_FTRACE_DIRECT_MULTI=y
|
||||||
|
CONFIG_ARCH_HAS_DEVMEM_IS_ALLOWED=y
|
||||||
|
CONFIG_STRICT_DEVMEM=y
|
||||||
|
```
|
||||||
39
src/routes/blog/kagi/+page.md
Normal file
39
src/routes/blog/kagi/+page.md
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
---
|
||||||
|
created: '2024-06-11'
|
||||||
|
title: "Kagi.com"
|
||||||
|
description: ""
|
||||||
|
keywords:
|
||||||
|
- search engine
|
||||||
|
hidden: false
|
||||||
|
---
|
||||||
|
<script>
|
||||||
|
import fastgpt from "./images/fastgpt.png?default"
|
||||||
|
import Image from "$components/Image.svelte"
|
||||||
|
</script>
|
||||||
|
|
||||||
|
Kagi is a paid search engine providing excellent search that reminds me of what Google was like in the early 2000s. Furthermore, it provides search-enhancing features like specific filters, custom site rankings, and an LLM summary of the search results.
|
||||||
|
In this post, I would like to share my thoughts on Kagi.com and explain why I think it is a great search engine despite recent criticism.
|
||||||
|
|
||||||
|
## Search Quality
|
||||||
|
Kagi's search quality is much superior to that of its competitors. The first few results usually include either links to the documentation or - if applicable - blog posts of tiny websites that are not well-known.
|
||||||
|
Google has been overflooded by SEO spam: sites that do not contain any useful information but are optimized to be indexed high in search results. Kagi's search results are much cleaner and more relevant.
|
||||||
|
|
||||||
|
If, for some reason, a bad site appears in the search results, I can easily block it. More relevant sites like Wikipedia or StackOverflow can be promoted to the top of the search results.
|
||||||
|
|
||||||
|
## AI Summary
|
||||||
|
Kagi's AI will summarize the search results by simply appending a `?` to the end of the search query. LLMs are prone to generating nonsense, but Kagi's AI adds citations with links to the original source. If the AI summary provided helpful information, it was accurate; if it did not, the results were still there.
|
||||||
|
|
||||||
|
<Image meta={fastgpt} alt="Example search query"/>
|
||||||
|
|
||||||
|
## Privacy
|
||||||
|
|
||||||
|
By default, since the search engine requires registration and payment, Kagi could theoretically track the user's search history. However, I have no reason to believe that Kagi is doing this. Kagi repeatedly stated that they are a small company that aims to do things differently, i.e., not maximize profit over sustainability. That is also why they give free T-shirts to the first 20k users. Although I'm not convinced this is a wise business decision, I respect their commitment to their user base.
|
||||||
|
|
||||||
|
In recent criticism, Kagi's CEO Vlad has made questionable privacy statements. Mainly, he claimed that an Email address is not PII (Personally Identifiable Information) because the user could create single-use Email addresses. That statement is obviously regrettable, but the CEO has clarified and will be more careful in the future. Just because a CEO is more outspoken and engaging with the community (which does not happen often - if ever) and sometimes says woeful things does not mean that the company as a whole should be boycotted. It should be seen as a way to engage with the company and perhaps improve it. Kagi is the best we have right now, and I am happy to support them.
|
||||||
|
|
||||||
|
This entire privacy discussion boils down to a big "trust me, bro" which I am willing to give Kagi - for now.
|
||||||
|
I pay for search; at least I know that Kagi does not have to sell my data to keep the lights on - unlike specific competitors.
|
||||||
|
|
||||||
|
## Conclusion
|
||||||
|
|
||||||
|
Kagi is a great search engine that I can recommend to anyone who is tired of Google's SEO spam and wants to support a small company that is trying to do things differently. The search results are excellent, and the AI summaries are a nice addition. I am looking forward to seeing how Kagi will develop in the future.
|
||||||
BIN
src/routes/blog/kagi/images/fastgpt.png
Normal file
BIN
src/routes/blog/kagi/images/fastgpt.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 268 KiB |
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
created: '2022-08-12'
|
created: '2022-08-12'
|
||||||
title: "Do's and dont's when writing a thesis"
|
title: "Do's and don't when writing a thesis"
|
||||||
description: 'Useful tips for avoiding common mistakes when writing a thesis. Includes recommendations for writing, formatting, figures and Latex.'
|
description: 'Useful tips for avoiding common mistakes when writing a thesis. Includes recommendations for writing, formatting, figures and Latex.'
|
||||||
keywords:
|
keywords:
|
||||||
- thesis
|
- thesis
|
||||||
|
|
@ -13,11 +13,10 @@ hidden: false
|
||||||
---
|
---
|
||||||
|
|
||||||
When I wrote my Bachelor's thesis in computer science, I had barely any experience with
|
When I wrote my Bachelor's thesis in computer science, I had barely any experience with
|
||||||
academic writing. So far, I only attended one seminar about OT security, where I wrote a
|
academic writing. So far, I only attended one seminar about OT security, where I wrote a small 10-page paper, which was not published. Although I learned the basics of Latex and
|
||||||
small 10 page paper, which was not published. Although I learned the basics of Latex and
|
|
||||||
academic writing, it was less comprehensive than the requirements in my thesis.
|
academic writing, it was less comprehensive than the requirements in my thesis.
|
||||||
|
|
||||||
First, check your faculties homepage for guidelines. They usually provide extensive
|
First, check your faculty's homepage for guidelines. They usually provide extensive
|
||||||
documents on style, format, and writing. Ultimately, these documents overrule any other
|
documents on style, format, and writing. Ultimately, these documents overrule any other
|
||||||
advice you may find on dubious websites.
|
advice you may find on dubious websites.
|
||||||
|
|
||||||
|
|
@ -28,10 +27,10 @@ General notes:
|
||||||
- In chapter/section headlines, do not add the acronym.
|
- In chapter/section headlines, do not add the acronym.
|
||||||
Good: `3. Data Plane Development Kit`.
|
Good: `3. Data Plane Development Kit`.
|
||||||
Bad: `3. Data Plane Development Kit (DPDK)`
|
Bad: `3. Data Plane Development Kit (DPDK)`
|
||||||
- Avoid enumerations in brackets; instead use "such as"
|
- Avoid enumerations in brackets; instead, use "such as"
|
||||||
- Use a spellchecker!
|
- Use a spellchecker!
|
||||||
- Read out loud to detect errors or strange wording
|
- Read out loud to detect errors or strange wording
|
||||||
- Do not use a new page for a couple sentences. At least fill 1/4 or even more of a page.
|
- Do not use a new page for a couple of sentences. At least fill 1/4 or even more of a page.
|
||||||
- Do not add Section 7.1 when you do not have a 7.2
|
- Do not add Section 7.1 when you do not have a 7.2
|
||||||
- Check for double spaces
|
- Check for double spaces
|
||||||
- Tables/Listings/... should not reach into the side margin
|
- Tables/Listings/... should not reach into the side margin
|
||||||
|
|
@ -39,7 +38,7 @@ General notes:
|
||||||
- Do not ever use forward references
|
- Do not ever use forward references
|
||||||
- Section/Chapter/Listing always with uppercase (this might be TUM specific?)
|
- Section/Chapter/Listing always with uppercase (this might be TUM specific?)
|
||||||
- Tables should never have vertical lines
|
- Tables should never have vertical lines
|
||||||
- Check for consistent dashing in words such as "low-latency"
|
- Check for consistent dashing in words such as "low latency" vs "low-latency"
|
||||||
|
|
||||||
Latex:
|
Latex:
|
||||||
|
|
||||||
|
|
@ -50,9 +49,8 @@ Latex:
|
||||||
|
|
||||||
Figures:
|
Figures:
|
||||||
|
|
||||||
- Avoid png or jpegs. Instead use vector graphics such as svg
|
- Avoid png or jpegs. Instead, use vector graphics such as SVG
|
||||||
- Do not write a novel in a figure caption. The caption is printed in the table of
|
- Do not write a novel in a figure caption. The caption is printed in the table of contents; large sentences look strange there and decrease readability
|
||||||
content; large sentences look strange there and decrease readability
|
|
||||||
- A figure should have the same font as the remaining thesis
|
- A figure should have the same font as the remaining thesis
|
||||||
- Avoid hard-to-read colors like yellow in figures
|
- Avoid hard-to-read colors like yellow in figures
|
||||||
|
|
||||||
|
|
@ -60,14 +58,14 @@ Figures:
|
||||||
|
|
||||||
_I am not affiliated with any service mentioned here_
|
_I am not affiliated with any service mentioned here_
|
||||||
|
|
||||||
I personally have had good experience with
|
I have had good experience with
|
||||||
[Writefull](https://www.writefull.com/writefull-for-overleaf). More specifically, compared
|
[Writefull](https://www.writefull.com/writefull-for-overleaf). More specifically, compared
|
||||||
to alternatives, they support Latex. They trained their AI with scientific papers so that
|
to alternatives, they support Latex. They trained their AI with scientific papers so that
|
||||||
the recommendations mostly match the expected writing style. Especially when it comes to
|
the recommendations mostly match the expected writing style. Especially when it comes to
|
||||||
commas, it pointed out many mistakes which I would have not noticed on my own.
|
commas, it pointed out many mistakes which I would have not noticed on my own.
|
||||||
|
|
||||||
One thing I disliked about Writefull is that it is only available for Word documents or
|
One thing I disliked about Writefull is that it is only available for Word documents or
|
||||||
Overleaf. I am using neither. Therefore, I had to copy paste my tex files from my local
|
Overleaf. I am using neither. Therefore, I had to copy and paste my tex files from my local
|
||||||
editor to Overleaf. A bit of a hassle, but okay. Another thing I noticed is that the Latex
|
editor to Overleaf. A bit of a hassle, but okay. Another thing I noticed is that the Latex
|
||||||
acronym package is not supported. Often it would suggest to reorder my `\ac{DPDK}` so that
|
acronym package is not supported. Often, it would suggest reordering my \ac so that
|
||||||
it does not make sense afterwards.
|
it does not make sense afterward.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue