kerneloops | automatically collect and submit kernel crash signatures
kandi X-RAY | kerneloops Summary
kandi X-RAY | kerneloops Summary
Tool to automatically collect and submit kernel crash signatures
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of kerneloops
kerneloops Key Features
kerneloops Examples and Code Snippets
Community Discussions
Trending Discussions on kerneloops
QUESTION
Feel free to edit the title; not sure how to word it. I'm trying to turn shell output into JSON data for a reporting system I'm writing for work. Quick question, no matter what i do, when I take raw input in slurp mode and output the JSON, the last item in the array is blank (""). I feel like this is some sort of rookie jq
issue I'm running into, but can't figure out how to word the issue. This seems to happen no matter what command I run on the shell and pipe to jq
:
ANSWER
Answered 2018-Oct-03 at 05:47Every line ends with a newline. Either remove the final newline, or omit the empty element at the end of the array.
QUESTION
I'm writing some kernel driver where I need to check which thread is running at a certain point on another cores. My driver runs one kernel thread on per core and I need to sync from time to time some of the threads to do certain task. What I can observe from debugging logs is that sometimes one thread waits for some other threads too much. I did some patch where I store the __preempt_count
on other cores to check if any softirq/hardirq or preemption disabled delays my thread.
I also used the FTRACE to check the irqsoff and preemptirqsoff for the max duration of IRQs off and preemption disabled.
Till now I was able to spot kerneloops thread which is disabling interrupts up to 20msec, which I find too long.
Did a systemctl disable kerneloops
and got rid of this issue.
Now I seem to deal with some preemption disabled windows. For future analysis of this driver I need a way to figure out which threads are being executed at a particular point in time on other cores. I'm trying to use FTRACE mainly with events for IRQ entry/exit, I also use trace_printk
to push some debug log in the ftrace buffer to to have everything in one log, etc.
However, one thing that I would like to do is to access the current_task
structure of other cores (the current
ptr) and print the comm
field which gives the name of the task (or pid value).
But I'm having hard times in getting this done.
For __preempt_count
I had no issue:
ANSWER
Answered 2017-Oct-17 at 11:05I finally figured out what was wrong.
The difference between __preempt_count
and current_task
is that first one is defined as an int variable, whereas the 2nd one as a pointer to structure. In other words 1st one is defined as a variable and the 2nd one as a pointer.
Now, looking deeper into per cpu variables, they are just variables allocated by the compiler in separate memory locations, like an array. When per_cpu_ptr
for a variable Foo is called, then the macro computes something like Foo[cpu]
, but that means the per_cpu_ptr
needs the actual base address of the variable, meaning the &
so that it can compute the relative address value starting from this.
When declaring: foo = per_cpu_ptr(&__preempt_count,cpu)
, this address is already given = &__preempt_count
When declaring: bar = per_cpu_ptr(current_task,cpu)
, this address is not given, as the &
is missing here. The current_task is a pointer but not the base address of the current_task array.
In both above cases the argument to per_cpu_ptr
is a pointer, but here my understanding was wrong, it was not clear to me what is actually the pointer of the variable I need to pass, now it's clear: I have to pass the base address of the variable(var or pointer doesn't matter) so that the macro can compute the relative address for that cpu.
Therefore the right approaches that work are:
bar = per_cpu(current_task,cpu)
which translates into *per_cpu_var(¤t_task,cpu)
or directly
bar = *per_cpu_var(¤t_task,cpu);
QUESTION
I have an array of object containing a status and a name property.
I want to use them based on their name
property using the following code:
ANSWER
Answered 2017-Jul-03 at 17:53You are sorting by the expression a.name - b.name
which for your data is always NaN
.
If you are trying to sort alphabetically you might want to see this post:
Javascript - sort objects in an array alphabetically on one property of the array
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install kerneloops
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page