Table of contents

Embed github

Directly embed github source code like gist with Prism.js syntax highlight.

Usage

{{< emgithub target="" lang="" hl="" tab_size="" />}}

Paramters:

Examples

{{< emgithub target="https://github.com/torvalds/linux/blob/v5.4/README" />}}
Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.
{{< emgithub target="https://github.com/torvalds/linux/blob/v5.4/arch/arm64/kernel/stacktrace.c#L171-L199" lang=c tab_size=8 hl="172-173,192" />}}
static noinline void __save_stack_trace(struct task_struct *tsk,
	struct stack_trace *trace, unsigned int nosched)
{
	struct stack_trace_data data;
	struct stackframe frame;

	if (!try_get_task_stack(tsk))
		return;

	data.trace = trace;
	data.skip = trace->skip;
	data.no_sched_functions = nosched;

	if (tsk != current) {
		start_backtrace(&frame, thread_saved_fp(tsk),
				thread_saved_pc(tsk));
	} else {
		/* We don't want this function nor the caller */
		data.skip += 2;
		start_backtrace(&frame,
				(unsigned long)__builtin_frame_address(0),
				(unsigned long)__save_stack_trace);
	}

	walk_stackframe(tsk, &frame, save_trace, &data);

	put_task_stack(tsk);
}
EXPORT_SYMBOL_GPL(save_stack_trace_tsk);