~ubuntu-branches/ubuntu/precise/mysql-5.5/precise-201203300109

« back to all changes in this revision

Viewing changes to storage/ndb/src/common/debugger/signaldata/FsReadWriteReq.cpp

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2011-11-08 11:31:13 UTC
  • Revision ID: package-import@ubuntu.com-20111108113113-3ulw01fvi4vn8m25
Tags: upstream-5.5.17
ImportĀ upstreamĀ versionĀ 5.5.17

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (C) 2003 MySQL AB
 
2
 
 
3
   This program is free software; you can redistribute it and/or modify
 
4
   it under the terms of the GNU General Public License as published by
 
5
   the Free Software Foundation; version 2 of the License.
 
6
 
 
7
   This program is distributed in the hope that it will be useful,
 
8
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
9
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
10
   GNU General Public License for more details.
 
11
 
 
12
   You should have received a copy of the GNU General Public License
 
13
   along with this program; if not, write to the Free Software
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
15
 
 
16
 
 
17
 
 
18
#include <signaldata/FsReadWriteReq.hpp>
 
19
 
 
20
bool
 
21
printFSREADWRITEREQ(FILE * output, const Uint32 * theData, 
 
22
                    Uint32 len, Uint16 receiverBlockNo){
 
23
 
 
24
  bool ret = true;
 
25
  
 
26
  const FsReadWriteReq * const sig = (FsReadWriteReq *) theData;
 
27
  
 
28
  fprintf(output, " UserPointer: %d\n", sig->userPointer);
 
29
  fprintf(output, " FilePointer: %d\n", sig->filePointer);
 
30
  fprintf(output, " UserReference: H\'%.8x", sig->userReference);
 
31
 
 
32
  fprintf(output, " Operation flag: H\'%.8x (", sig->operationFlag);
 
33
  if (sig->getSyncFlag(sig->operationFlag))
 
34
    fprintf(output, "Sync,");
 
35
  else
 
36
    fprintf(output, "No sync,");
 
37
 
 
38
  fprintf(output, " Format=");
 
39
  switch(sig->getFormatFlag(sig->operationFlag)){
 
40
  case FsReadWriteReq::fsFormatListOfPairs:
 
41
    fprintf(output, "List of pairs)\n");
 
42
    break;
 
43
  case FsReadWriteReq::fsFormatArrayOfPages:
 
44
    fprintf(output, "Array of pages)\n");
 
45
    break;
 
46
  case FsReadWriteReq::fsFormatListOfMemPages:
 
47
    fprintf(output, "List of mem pages)\n");
 
48
    break;
 
49
  case FsReadWriteReq::fsFormatGlobalPage:
 
50
    fprintf(output, "List of global pages)\n");
 
51
  case FsReadWriteReq::fsFormatSharedPage:
 
52
    fprintf(output, "List of shared pages)\n");
 
53
    break;
 
54
  default:
 
55
    fprintf(output, "fsFormatMax not handled\n");
 
56
    ret = false;
 
57
    break;
 
58
  }
 
59
    
 
60
  fprintf(output, " varIndex: %d\n", 
 
61
          sig->varIndex);    
 
62
  fprintf(output, " numberOfPages: %d\n", 
 
63
          sig->numberOfPages);
 
64
  fprintf(output, " pageData: ");
 
65
 
 
66
  unsigned int i;
 
67
  switch(sig->getFormatFlag(sig->operationFlag)){
 
68
  case FsReadWriteReq::fsFormatListOfPairs:
 
69
    for (i= 0; i < sig->numberOfPages*2; i += 2){
 
70
      fprintf(output, " H\'%.8x, H\'%.8x\n", sig->data.pageData[i], 
 
71
                                             sig->data.pageData[i + 1]);
 
72
    }
 
73
    break;
 
74
  case FsReadWriteReq::fsFormatArrayOfPages:
 
75
    fprintf(output, " H\'%.8x, H\'%.8x\n", sig->data.pageData[0], 
 
76
                                           sig->data.pageData[1]);
 
77
    break;
 
78
  case FsReadWriteReq::fsFormatListOfMemPages:
 
79
    for (i= 0; i < (sig->numberOfPages + 1); i++){
 
80
      fprintf(output, " H\'%.8x, ", sig->data.pageData[i]);
 
81
    }
 
82
    break;
 
83
  case FsReadWriteReq::fsFormatGlobalPage:
 
84
    for (i= 0; i < sig->numberOfPages; i++){
 
85
      fprintf(output, " H\'%.8x, ", sig->data.pageData[i]);
 
86
    }
 
87
    break;
 
88
  default:
 
89
    fprintf(output, "Impossible event\n");
 
90
  }
 
91
 
 
92
  fprintf(output, "\n");
 
93
  return ret;
 
94
}