List:Internals« Previous MessageNext Message »
From:ghazel Date:July 9 2011 3:12pm
Subject:Re: "OS thread id" removed
View as plain text  
On Sat, Jul 9, 2011 at 7:44 AM, Davi Arnaut <davi.arnaut@stripped> wrote:
> On 7/9/11 11:27 AM, ghazel@stripped wrote:
>> On Sat, Jul 9, 2011 at 7:26 AM, Davi Arnaut <davi.arnaut@stripped>
> wrote:
>>> On 7/9/11 11:14 AM, ghazel@stripped wrote:
>>>> On Sat, Jul 9, 2011 at 7:00 AM, Davi Arnaut
> <davi.arnaut@stripped> wrote:
>>>>> On 7/6/11 1:50 PM, ghazel@stripped wrote:
>>>>>> First off, where can I find a real commit message? Second, is
> there no
>>>>>> way to get the OS thread id now? It was very handy when tying
> MySQL
>>>>>> thread id to OS thread id for debugging with gdb.
>>>>>
>>>>> How did you tie the MySQL thread id to the OS thread id? InnoDB did
> not
>>>>> actually provide the OS thread id, it provide the value of the
> thread
>>>>> descriptor. It was handy for locating the THD object? What exactly
> did
>>>>> it help with?
>>>>
>>>> The "show engine innodb status" transaction output list(ed) both the
>>>> "MySQL thread id" and the "OS thread id":
>>>> ---TRANSACTION CF5F643A, ACTIVE 14 sec, process no 410, OS thread id
> 1493494080
>>>> 2 lock struct(s), heap size 376, 1 row lock(s)
>>>> MySQL thread id 928182, query id 43574254 localhost root User sleep
>>>> select sleep(200)
>>>>
>>>> When represented in hex, 1493494080 is 0x5904e940 which matches the
>>>> identifier printed by gdb:
>>>>
>>>> Thread 11 (Thread 0x5904e940 (LWP 1113)):
>>>
>>> 0x5904e940 is the thread handle (ie pthread_self()), while 1113 is the
>>> actual thread id. So, basically, you just want to be able to identify
>>> which particular actual thread was last associated with a query/trans?
>>
>> That's right.
>
> Does the attached patch fix it for you?
>

Yes, that works great! As you point out in the gdb output I could
probably make use of the thread id as opposed to the handle just as
easily if there is any reason to print that instead.

Thanks for your help!

-Greg
Thread
"OS thread id" removedghazel6 Jul
  • Re: "OS thread id" removedKristian Nielsen6 Jul
    • Re: "OS thread id" removedSergei Golubchik6 Jul
  • Re: "OS thread id" removedDavi Arnaut9 Jul
    • Re: "OS thread id" removedghazel9 Jul
      • Re: "OS thread id" removedDavi Arnaut9 Jul
        • Re: "OS thread id" removedghazel9 Jul
          • Re: "OS thread id" removedDavi Arnaut9 Jul
            • Re: "OS thread id" removedghazel9 Jul
Re: "OS thread id" removedMARK CALLAGHAN6 Jul