Re: How to get user level stack trace of an application from system crash

2015-10-07 Thread Pranay Srivastava
On Tue, Oct 6, 2015 at 11:23 AM, Shailendra Rana
 wrote:
> Hi,
>
> I have an application which traps file events using fanotify, process
> these events and gives a verdict to fanotify whether access to a file
> is allowed or not. However, in some cases the verdict does not reach
> fanotify and system freezes. In such a case I just have system crash
> to analyze the issue.

Do you've any specific steps? Which kernel version you are using?

>
> My question is that is it possible to get a user level stack trace of
> an application using system crash ?
>
> Thanks and regards,
> Shailendra
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



-- 
---P.K.S

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: how to expand linux kernel macro in kernel source code/kernel module(outside)

2015-10-07 Thread Vishal Thanki
You may want to try following. That will expand all the macros in
kernel/cpu.c file.

# make kernel/cpu.i


You may try with your required files.


Vishal


On Tue, Oct 6, 2015 at 9:17 PM, Manavendra Nath Manav 
wrote:

>
> On Tue 6 Oct, 2015 18:34 慕冬亮  wrote:
>
> Recently I was learning doubly linked list in kernel, there are many
> macro in linux/fs.h, like list_add, list_del,list_for_each,list_entry,
> container_of.
>
> I know we can use "gcc -E" to expand the macro, but how do we expand
> the macro in kernel source code / kernel module?
>
> - mudongliang
>
> 
>
>
>
> A quick look at cscope and ctags will solve your problem.
>
> -- manav
>
>
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Eudyptula challenge task 8 no reply so far

2015-10-07 Thread Vinicius Tinti
Hi,

Is anyone stuck on task 8 too? I have sent again my files and notice
that it is still processing September 5th.

Could someone check?

Regards,
Vinicius

-- 
Simplicity is the ultimate sophistication

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Eudyptula challenge task 8 no reply so far

2015-10-07 Thread Vinicius Tinti
On Wed, Oct 7, 2015 at 4:34 PM, Ksenija Stanojevic
 wrote:
>
>
>
> On Wednesday, October 7, 2015 9:27 PM, Vinicius Tinti 
>  wrote:
> Hi,
>
> Is anyone stuck on task 8 too? I have sent again my files and notice
> that it is still processing September 5th.
>
> Could someone check?
>
>
> I got a response for task 8 on september 5th, and i sent the task on august 
> 14th.
> But I'm still waiting for response for task 9, sent on september 13th :(

The queue also has increased a lot. I wont be surprise if it is frozen.

> Ksenija
> --
> Simplicity is the ultimate sophistication
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



-- 
Simplicity is the ultimate sophistication

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Eudyptula challenge task 8 no reply so far

2015-10-07 Thread Karthik Nayak
On Thu, Oct 8, 2015, 1:07 AM Vinicius Tinti  wrote:

On Wed, Oct 7, 2015 at 4:34 PM, Ksenija Stanojevic
_ksen...@yahoo.com
> wrote:
>
>
>
> On Wednesday, October 7, 2015 9:27 PM, Vinicius Tinti <
viniciusti...@gmail.com> wrote:
> Hi,
>
> Is anyone stuck on task 8 too? I have sent again my files and notice
> that it is still processing September 5th.
>
> Could someone check?
>
>
> I got a response for task 8 on september 5th, and i sent the task on
august 14th.
> But I'm still waiting for response for task 9, sent on september 13th :(

The queue also has increased a lot. I wont be surprise if it is frozen.

> Ksenija
> --
> Simplicity is the ultimate sophistication
>

-
Task NumberPeopleQueue Length
-
  Finished111
20 36 12
19 15  0
18 34 22
17  8  0
16 37  0
15 19 11
14 17  7
13  3  1
12  7  0
11 52  1
10 75  0
09 61 14
08211173
07 51  2
06296 51
05899 16
04555 37
03303  5
02793  3
01   1239 24
-

Should take a while
-- 

Regards,
Karthik
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: How to get user level stack trace of an application from system crash

2015-10-07 Thread Shailendra Rana
On 7 October 2015 at 12:20, Vishal Thanki  wrote:
> Hi Shailendra,
>
> You may want to run your application using strace/ltrace which may help you
> identify which system call/library call is actually causing the crash. You
> may have to look around the application source surrounded by that system
> call/library call and have to find the clue. I am not aware of any other way
> to get the user level stacktrace.
>
> Vishal
>
> On Tue, Oct 6, 2015 at 11:23 AM, Shailendra Rana
>  wrote:
>>
>> Hi,
>>
>> I have an application which traps file events using fanotify, process
>> these events and gives a verdict to fanotify whether access to a file
>> is allowed or not. However, in some cases the verdict does not reach
>> fanotify and system freezes. In such a case I just have system crash
>> to analyze the issue.
>>
>> My question is that is it possible to get a user level stack trace of
>> an application using system crash ?
>>
>> Thanks and regards,
>> Shailendra
>>
>> ___
>> Kernelnewbies mailing list
>> Kernelnewbies@kernelnewbies.org
>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>

Hi,

Yes, for in-house debugging it can be done but this may not be
possible if this application is running on a customer system. In that
case I would just have the crash dump.

Thanks and regards,
Shailendra

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: How to get user level stack trace of an application from system crash

2015-10-07 Thread Anupam Kapoor

> [2015-10-07T14:55:07+0530]: "Shailendra Rana" (shailendra.rana1982):
,[ shailendra.rana1982 ]
| The application traps file events and send them over to other system
| via TCP. This other machine is running a third party solution which
| process these events and sends the verdict to the application which
| passes on the same to fanotify based on which decision of access to a
| file is made. I have seen this freeze issue in case of network
| failures but those are identifiable. There are couple of cases
| mentioned below which may lead to this.
| 
| 1) The event is received by third party solution but it did not send
| the verdict to the application. In that scenario need to notify this
| third party for fixing the issue.
| 2) Verdict is received by an application but could not pass on the
| same to fantiofy maybe it is stuck in an infinite loop. In this case I
| need to work towards fixing my application.
| 
| In order to identify the correct root cause I would want to have a
| user level stack trace of this application. Using crash tool I could
| not figure out the same.
| 
| I am using 3.13.0-24-generic #47-Ubuntu.
`
one word: libunwind

also, this is not a kernel topic, afaik
-- 
kind regards
anupam

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


make headers_install for out-of-tree modules

2015-10-07 Thread Daniel.
Hi all,

I'm trying  to install headers from out-of-tree module. I've writed
this[1] Makefile. I have Kbuild files with header-y tokens poiting for
propper folders and files. When I run "make headers_install" I got
this[2] error message,

[1] http://pastebin.com/9f3kYT8k
[2] http://pastebin.com/yfi69nUi

Any idea?

Best regards,

-- 
"Do or do not. There is no try"
  Yoda Master

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: make headers_install for out-of-tree modules

2015-10-07 Thread Daniel.
Uhh, as I see from docs, this isn't supported,

--- 2.3 Targets

When building an external module, only a subset of the "make"
targets are available.
>From https://www.kernel.org/doc/Documentation/kbuild/modules.txt

So, how can I export ioctl calls defined by an out-of-tree module?

2015-10-07 10:46 GMT-03:00 Daniel. :
> Hi all,
>
> I'm trying  to install headers from out-of-tree module. I've writed
> this[1] Makefile. I have Kbuild files with header-y tokens poiting for
> propper folders and files. When I run "make headers_install" I got
> this[2] error message,
>
> [1] http://pastebin.com/9f3kYT8k
> [2] http://pastebin.com/yfi69nUi
>
> Any idea?
>
> Best regards,
>
> --
> "Do or do not. There is no try"
>   Yoda Master



-- 
"Do or do not. There is no try"
  Yoda Master

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: make headers_install for out-of-tree modules

2015-10-07 Thread Yann Droneaud
Hi,

Le mercredi 07 octobre 2015 à 10:51 -0300, Daniel. a écrit :
> Uhh, as I see from docs, this isn't supported,
> 
> --- 2.3 Targets
> 
> When building an external module, only a subset of the "make"
> targets are available.
> > From https://www.kernel.org/doc/Documentation/kbuild/modules.txt
> 
> So, how can I export ioctl calls defined by an out-of-tree module?
> 

I had the same expectation and it was a sad day when I found myself
having to do it manually in the out of tree makefile, having to handle
__user annotations in particular, as it wasn't possible to call
scripts/headers_install.sh as scripts/unifdef.c wasn't compiled and
available in the various kernel build environment provided by
distribution packages.

PS: please, don't top post reply, thanks.

> 2015-10-07 10:46 GMT-03:00 Daniel. :
> > Hi all,
> > 
> > I'm trying  to install headers from out-of-tree module. I've writed
> > this[1] Makefile. I have Kbuild files with header-y tokens poiting
> > for
> > propper folders and files. When I run "make headers_install" I got
> > this[2] error message,
> > 
> > [1] http://pastebin.com/9f3kYT8k
> > [2] http://pastebin.com/yfi69nUi
> > 
> > Any idea?


Regards.

-- 
Yann Droneaud
OPTEYA


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: make headers_install for out-of-tree modules

2015-10-07 Thread Greg KH
On Wed, Oct 07, 2015 at 10:51:25AM -0300, Daniel. wrote:
> Uhh, as I see from docs, this isn't supported,
> 
> --- 2.3 Targets
> 
> When building an external module, only a subset of the "make"
> targets are available.
> >From https://www.kernel.org/doc/Documentation/kbuild/modules.txt
> 
> So, how can I export ioctl calls defined by an out-of-tree module?

You get your out-of-tree module merged into the tree and it's
automatically solved for you :)

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: UIO Devices and user processes

2015-10-07 Thread Kenneth Adam Miller
Well I don't think I'll have to write a custom allocator. Existing
allocators allow you to have placement allocation, or rather more
precisely, manage sub-buffers within a static buffer. By this I mean that
the sub buffer is treated as though it were an existing slab given to the
process by the OS, but instead of actually servicing it with new and free,
you place a table in it that acts just like the table that libc manages and
coalesces during regular management with typical use. In any case, I think
I don't have to do this because it's just a regular consumer producer
issue, and I can use ring buffers for that.

On Wed, Oct 7, 2015 at 1:02 PM, Greg KH  wrote:

> On Tue, Oct 06, 2015 at 10:46:49AM -0400, Kenneth Adam Miller wrote:
> > Let me be more precise in general to the overall original question:
> >
> > I want a userland process that I designate to only use a specific hard
> coded
> > region physical of memory for it's heap. A UIO driver is the means by
> which
> > I've gone about seeking to achieve this.
>
> Use LD_PRELOAD to hook into your custom library that handles the
> allocation to this special portion of memory that you grabbed from the
> hardware using the UIO kernel interface instead of the "normal" libc
> allocator, and you will be fine.  But you will have to write a custom
> allocator, there's no other way around that.
>
> The kernel gives you the ability to do this today, no kernel changes
> needed, it's all "just" userspace code you will have to do on your own.
>
> Best of luck, that's going to be some "fun" work :)
>
> greg k-h
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: UIO Devices and user processes

2015-10-07 Thread Greg KH
On Tue, Oct 06, 2015 at 10:46:49AM -0400, Kenneth Adam Miller wrote:
> Let me be more precise in general to the overall original question:
> 
> I want a userland process that I designate to only use a specific hard coded
> region physical of memory for it's heap. A UIO driver is the means by which
> I've gone about seeking to achieve this. 

Use LD_PRELOAD to hook into your custom library that handles the
allocation to this special portion of memory that you grabbed from the
hardware using the UIO kernel interface instead of the "normal" libc
allocator, and you will be fine.  But you will have to write a custom
allocator, there's no other way around that.

The kernel gives you the ability to do this today, no kernel changes
needed, it's all "just" userspace code you will have to do on your own.

Best of luck, that's going to be some "fun" work :)

greg k-h

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies